~ubuntu-branches/ubuntu/trusty/libgrip/trusty-proposed

« back to all changes in this revision

Viewing changes to debian/patches/0001-g_io_shutdown.patch

  • Committer: Package Import Robot
  • Author(s): Chase Douglas
  • Date: 2011-09-23 10:34:36 UTC
  • Revision ID: package-import@ubuntu.com-20110923103436-kdy6l4qsk8wxigw9
Tags: 0.3.2-0ubuntu2
Properly handle GTK+ IO channel shutdown (LP: #830640)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
=== modified file 'src/gripgesturemanager.c'
 
2
--- a/src/gripgesturemanager.c  2011-09-02 10:40:35 +0000
 
3
+++ b/src/gripgesturemanager.c  2011-09-23 17:26:45 +0000
 
4
@@ -87,6 +87,7 @@
 
5
   GPtrArray         *gesture_list;
 
6
   GeisInstance       instance;
 
7
   GIOChannel        *iochannel;
 
8
+  int                iochannel_id;
 
9
 };
 
10
 
 
11
 struct _GripRegistrationRequest
 
12
@@ -966,8 +967,15 @@
 
13
     }
 
14
 
 
15
   g_list_free (reg->bindings);
 
16
-  g_io_channel_shutdown (reg->iochannel, TRUE, NULL);
 
17
+
 
18
+  g_io_channel_shutdown (reg->iochannel, FALSE, NULL);
 
19
+  g_source_remove (reg->iochannel_id);
 
20
+  g_io_channel_unref (reg->iochannel);
 
21
+
 
22
   geis_finish (reg->instance);
 
23
+
 
24
+  reg->instance = NULL;
 
25
+  reg->iochannel = NULL;
 
26
 }
 
27
 
 
28
 static void
 
29
@@ -1049,7 +1057,6 @@
 
30
 {
 
31
   GripGestureRegistration *reg;
 
32
   GeisInstance  instance;
 
33
-  GIOChannel   *iochannel;
 
34
   gint fd = -1;
 
35
   GeisXcbWinInfo xcb_win_info = {
 
36
     .display_name = NULL,
 
37
@@ -1092,14 +1099,11 @@
 
38
                     G_CALLBACK (window_destroyed_cb),
 
39
                     manager);
 
40
 
 
41
-  iochannel = g_io_channel_unix_new (fd);
 
42
-  g_io_add_watch (iochannel,
 
43
-                  G_IO_IN,
 
44
-                  io_callback,
 
45
-                  reg);
 
46
-
 
47
-  reg->iochannel = iochannel;
 
48
-
 
49
+  reg->iochannel = g_io_channel_unix_new (fd);
 
50
+  reg->iochannel_id = g_io_add_watch (reg->iochannel,
 
51
+                                      G_IO_IN,
 
52
+                                      io_callback,
 
53
+                                      reg);
 
54
   reg->gesture_list = g_ptr_array_new ();
 
55
 
 
56
   return reg;
 
57