~ubuntu-branches/ubuntu/maverick/ibus/maverick-updates

« back to all changes in this revision

Viewing changes to debian/patches/03_fix1104.patch

  • Committer: Bazaar Package Importer
  • Author(s): Ken VanDine, Karl Lattimer, Ikuya Awashiro, Ken VanDine
  • Date: 2010-11-16 09:57:35 UTC
  • mfrom: (25.1.1 ibus)
  • Revision ID: james.westby@ubuntu.com-20101116095735-e6tt9c3ek3lam2yi
Tags: 1.3.7-1ubuntu4
[ Karl Lattimer ]
* debia/patches/05_appindicator.patch
  - Fixed unresponsive menu, (LP: #645724)
  - Fixed 100% cpu usage properly, (LP: #637671)
  - Fixed focus tracking issue, (LP: #522079)

[ Ikuya Awashiro ]
* debian/patches/03_fix1104.patch: added.
  - http://code.google.com/p/ibus/issues/detail?id=1104
  - This patch fixed (LP: #637671) finally.

[ Ken VanDine ]
* debian/README.source
  - Removed, it was outdated and no longer correct

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
diff -uNr -x .pc ibus-1.3.7.orig//ui/gtk/panel.py ibus-1.3.7.1104//ui/gtk/panel.py
 
2
--- ibus-1.3.7.orig//ui/gtk/panel.py    2010-11-15 12:39:28.000000000 +0100
 
3
+++ ibus-1.3.7.1104//ui/gtk/panel.py    2010-11-15 12:45:09.000000000 +0100
 
4
@@ -23,6 +23,7 @@
 
5
 import gtk
 
6
 import gtk.gdk as gdk
 
7
 import gobject
 
8
+import glib
 
9
 import ibus
 
10
 import icon as _icon
 
11
 import os
 
12
@@ -63,15 +64,12 @@
 
13
         self.__bus = bus
 
14
         self.__config = self.__bus.get_config()
 
15
         self.__focus_ic = None
 
16
-        self.__setup_pid = 0
 
17
+        self.__setup_pid = None
 
18
         self.__prefix = os.getenv("IBUS_PREFIX")
 
19
         self.__data_dir = path.join(self.__prefix, "share", "ibus")
 
20
         # self.__icons_dir = path.join(self.__data_dir, "icons")
 
21
         self.__setup_cmd = path.join(self.__prefix, "bin", "ibus-setup")
 
22
 
 
23
-        # hanlder signal
 
24
-        signal.signal(signal.SIGCHLD, self.__sigchld_cb)
 
25
-
 
26
         # connect bus signal
 
27
         self.__config.connect("value-changed", self.__config_value_changed_cb)
 
28
         self.__config.connect("reloaded", self.__config_reloaded_cb)
 
29
@@ -501,20 +499,18 @@
 
30
         else:
 
31
             print >> sys.stderr, "Unknown command %s" % command
 
32
 
 
33
-    def __sigchld_cb(self, sig, sf):
 
34
-        try:
 
35
-            pid, status = os.wait()
 
36
-            if self.__setup_pid == pid:
 
37
-                self.__setup_pid = 0
 
38
-        except:
 
39
-            pass
 
40
+    def __child_watch_cb(self, pid, status):
 
41
+        self.__setup_pid.close()
 
42
+        self.__setup_pid = None
 
43
 
 
44
     def __start_setup(self):
 
45
-        if self.__setup_pid != 0:
 
46
-            pid, state = os.waitpid(self.__setup_pid, os.P_NOWAIT)
 
47
-            if pid != self.__setup_pid:
 
48
-                os.kill(self.__setup_pid, signal.SIGUSR1)
 
49
-                return
 
50
-            self.__setup_pid = 0
 
51
-        self.__setup_pid = os.spawnl(os.P_NOWAIT, self.__setup_cmd, "ibus-setup")
 
52
+        if self.__setup_pid:
 
53
+            # if setup dialog is running, bring the dialog to front by SIGUSR1
 
54
+            self.__setup_pid.close()
 
55
+            self.__setup_pid = None
 
56
+            return
 
57
+
 
58
+        pid = glib.spawn_async(argv=[self.__setup_cmd], flags=glib.SPAWN_DO_NOT_REAP_CHILD)[0]
 
59
+        self.__setup_pid = pid
 
60
+        glib.child_watch_add(self.__setup_pid, self.__child_watch_cb)
 
61