5f53fe
From cb519c852dfc7a652df1768c81974d750ef48f58 Mon Sep 17 00:00:00 2001
5f53fe
From: Daiki Ueno <ueno@unixuser.org>
5f53fe
Date: Thu, 29 Sep 2011 12:24:53 +0900
5f53fe
Subject: [PATCH] Fix hiding button items in GTK panel.
5f53fe
5f53fe
BUG=none
5f53fe
TEST=manual
5f53fe
5f53fe
Review URL: http://codereview.appspot.com/5148041
5f53fe
---
5f53fe
 ui/gtk/toolitem.py |   12 ++++--------
5f53fe
 1 files changed, 4 insertions(+), 8 deletions(-)
5f53fe
5f53fe
diff --git a/ui/gtk/toolitem.py b/ui/gtk/toolitem.py
5f53fe
index 4bdffba..4f4f97d 100644
5f53fe
--- a/ui/gtk/toolitem.py
5f53fe
+++ b/ui/gtk/toolitem.py
5f53fe
@@ -73,11 +73,9 @@ class ToolButton(gtk.ToolButton, PropItem):
5f53fe
         self.set_icon_name(self._prop.icon)
5f53fe
 
5f53fe
         if self._prop.visible:
5f53fe
-            self.set_no_show_all(False)
5f53fe
-            self.show_all()
5f53fe
+            self.show()
5f53fe
         else:
5f53fe
-            self.set_no_show_all(True)
5f53fe
-            self.hide_all()
5f53fe
+            self.hide()
5f53fe
 
5f53fe
     def do_clicked(self):
5f53fe
         self.emit("property-activate", self._prop.key, self._prop.state)
5f53fe
@@ -128,11 +126,9 @@ class ToggleToolButton(gtk.ToggleToolButton, PropItem):
5f53fe
         self.set_active(self._prop.state == ibus.PROP_STATE_CHECKED)
5f53fe
         self.set_sensitive(self._prop.sensitive)
5f53fe
         if self._prop.visible:
5f53fe
-            self.set_no_show_all(False)
5f53fe
-            self.show_all()
5f53fe
+            self.show()
5f53fe
         else:
5f53fe
-            self.set_no_show_all(True)
5f53fe
-            self.hide_all()
5f53fe
+            self.hide()
5f53fe
 
5f53fe
     def do_toggled(self):
5f53fe
         # Do not send property-activate to engine in case the event is
5f53fe
-- 
5f53fe
1.7.6.4
5f53fe
5f53fe
From d19018b8709847009d2e0836c942dd9f1385e7cb Mon Sep 17 00:00:00 2001
5f53fe
From: Yusuke Sato <yusukes@chromium.org>
5f53fe
Date: Sun, 9 Oct 2011 13:52:42 +0900
5f53fe
Subject: [PATCH] Always consume a hotkey press
5f53fe
5f53fe
BUG=1324
5f53fe
5f53fe
Review URL: http://codereview.appspot.com/5242044
5f53fe
---
5f53fe
 bus/ibusimpl.c |    6 +++---
5f53fe
 1 files changed, 3 insertions(+), 3 deletions(-)
5f53fe
5f53fe
diff --git a/bus/ibusimpl.c b/bus/ibusimpl.c
5f53fe
index 1942504..1494f5f 100644
5f53fe
--- a/bus/ibusimpl.c
5f53fe
+++ b/bus/ibusimpl.c
5f53fe
@@ -2066,21 +2066,21 @@ bus_ibus_impl_filter_keyboard_shortcuts (BusIBusImpl     *ibus,
5f53fe
         else {
5f53fe
             bus_input_context_enable (context);
5f53fe
         }
5f53fe
-        return (enabled != bus_input_context_is_enabled (context));
5f53fe
+        return TRUE;
5f53fe
     }
5f53fe
     if (event == enable_unconditional) {
5f53fe
         gboolean enabled = bus_input_context_is_enabled (context);
5f53fe
         if (!enabled) {
5f53fe
             bus_input_context_enable (context);
5f53fe
         }
5f53fe
-        return bus_input_context_is_enabled (context);
5f53fe
+        return TRUE;
5f53fe
     }
5f53fe
     if (event == disable_unconditional) {
5f53fe
         gboolean enabled = bus_input_context_is_enabled (context);
5f53fe
         if (enabled) {
5f53fe
             bus_input_context_disable (context);
5f53fe
         }
5f53fe
-        return !bus_input_context_is_enabled (context);
5f53fe
+        return TRUE;
5f53fe
     }
5f53fe
     if (event == next) {
5f53fe
         if (bus_input_context_is_enabled (context)) {
5f53fe
-- 
5f53fe
1.7.6.4
5f53fe
5f53fe
From ee966e327cc3b1b4bba40379bc0fbb3d46c38239 Mon Sep 17 00:00:00 2001
a4b3ac
From: fujiwarat <takao.fujiwara1@gmail.com>
5f53fe
Date: Tue, 25 Oct 2011 10:37:22 +0900
5f53fe
Subject: [PATCH] Add ibusutil.h in ibus.h
5f53fe
5f53fe
BUG=http://code.google.com/p/ibus/issues/detail?id=1338
5f53fe
TEST=Linux desktop
5f53fe
5f53fe
Review URL: http://codereview.appspot.com/5294054
5f53fe
---
5f53fe
 src/ibus.h |    1 +
5f53fe
 1 files changed, 1 insertions(+), 0 deletions(-)
5f53fe
5f53fe
diff --git a/src/ibus.h b/src/ibus.h
5f53fe
index 0765799..addc531 100644
5f53fe
--- a/src/ibus.h
5f53fe
+++ b/src/ibus.h
5f53fe
@@ -52,6 +52,7 @@
5f53fe
 #include <ibusconfig.h>
5f53fe
 #include <ibusconfigservice.h>
5f53fe
 #include <ibuspanelservice.h>
5f53fe
+#include <ibusutil.h>
5f53fe
 
5f53fe
 #undef __IBUS_H_INSIDE__
5f53fe
 
5f53fe
-- 
5f53fe
1.7.6.4
5f53fe
5f53fe
From 910f8a64098d89b04c50056f621ec1a49dd3e7ea Mon Sep 17 00:00:00 2001
5f53fe
From: fujiwarat <takao.fujiwara1@gmail.com>
5f53fe
Date: Tue, 25 Oct 2011 10:50:34 +0900
a4b3ac
Subject: [PATCH] Fix previous_engine without global engine.
a4b3ac
5f53fe
BUG=http://code.google.com/p/ibus/issues/detail?id=1331
5f53fe
TEST=Linux desktop
5f53fe
5f53fe
Review URL: http://codereview.appspot.com/5297047
a4b3ac
---
a4b3ac
 bus/ibusimpl.c |   31 +++++++++++++++++++------------
a4b3ac
 1 files changed, 19 insertions(+), 12 deletions(-)
a4b3ac
a4b3ac
diff --git a/bus/ibusimpl.c b/bus/ibusimpl.c
a4b3ac
index 1494f5f..0a4f3fb 100644
a4b3ac
--- a/bus/ibusimpl.c
a4b3ac
+++ b/bus/ibusimpl.c
a4b3ac
@@ -1044,13 +1044,14 @@ bus_ibus_impl_get_engine_desc (BusIBusImpl *ibus,
a4b3ac
 }
a4b3ac
 
a4b3ac
 /**
a4b3ac
- * bus_ibus_impl_context_request_next_engine_in_menu:
a4b3ac
+ * bus_ibus_impl_context_request_rotate_engine_in_menu:
a4b3ac
  *
a4b3ac
- * Process the "next_engine_in_menu" hotkey.
a4b3ac
+ * Process the "next_engine_in_menu" or "previous_engine" hotkey.
a4b3ac
  */
a4b3ac
 static void
a4b3ac
-bus_ibus_impl_context_request_next_engine_in_menu (BusIBusImpl     *ibus,
a4b3ac
-                                                   BusInputContext *context)
a4b3ac
+bus_ibus_impl_context_request_rotate_engine_in_menu (BusIBusImpl     *ibus,
a4b3ac
+                                                     BusInputContext *context,
a4b3ac
+                                                     gboolean         is_next)
a4b3ac
 {
a4b3ac
     BusEngineProxy *engine;
a4b3ac
     IBusEngineDesc *desc;
a4b3ac
@@ -1071,12 +1072,20 @@ bus_ibus_impl_context_request_next_engine_in_menu (BusIBusImpl     *ibus,
a4b3ac
 
a4b3ac
     p = g_list_find (ibus->register_engine_list, desc);
a4b3ac
     if (p != NULL) {
a4b3ac
-        p = p->next;
a4b3ac
+        if (is_next) {
a4b3ac
+            p = p->next;
a4b3ac
+        } else if (p->prev) {
a4b3ac
+            p = p->prev;
a4b3ac
+        }
a4b3ac
     }
a4b3ac
     if (p == NULL) {
a4b3ac
         p = g_list_find (ibus->engine_list, desc);
a4b3ac
         if (p != NULL) {
a4b3ac
-            p = p->next;
a4b3ac
+            if (is_next) {
a4b3ac
+                p = p->next;
a4b3ac
+            } else if (p->prev) {
a4b3ac
+                p = p->prev;
a4b3ac
+            }
a4b3ac
         }
a4b3ac
     }
a4b3ac
 
a4b3ac
@@ -1126,12 +1135,9 @@ bus_ibus_impl_context_request_previous_engine (BusIBusImpl     *ibus,
a4b3ac
         }
a4b3ac
     }
a4b3ac
 
a4b3ac
-    /*
a4b3ac
-     * If the previous engine name is not found, switch to the next engine
a4b3ac
-     * in the menu. This behavior is better than doing nothing.
a4b3ac
-     */
a4b3ac
     if (!engine_name) {
a4b3ac
-        bus_ibus_impl_context_request_next_engine_in_menu (ibus, context);
a4b3ac
+        bus_ibus_impl_context_request_rotate_engine_in_menu (ibus, context,
a4b3ac
+                                                             FALSE);
a4b3ac
         return;
a4b3ac
     }
a4b3ac
 
a4b3ac
@@ -2084,7 +2090,8 @@ bus_ibus_impl_filter_keyboard_shortcuts (BusIBusImpl     *ibus,
a4b3ac
     }
a4b3ac
     if (event == next) {
a4b3ac
         if (bus_input_context_is_enabled (context)) {
a4b3ac
-            bus_ibus_impl_context_request_next_engine_in_menu (ibus, context);
a4b3ac
+            bus_ibus_impl_context_request_rotate_engine_in_menu (ibus, context,
a4b3ac
+                                                                 TRUE);
a4b3ac
         }
a4b3ac
         else {
a4b3ac
             bus_input_context_enable (context);
a4b3ac
-- 
a4b3ac
1.7.6.4
5fabd6
5f53fe
From cca4fd8993613a6993965c3120323e43c4647ef5 Mon Sep 17 00:00:00 2001
5f53fe
From: Daiki Ueno <ueno@unixuser.org>
5f53fe
Date: Fri, 28 Oct 2011 15:42:08 +0900
5f53fe
Subject: [PATCH] Don't set focus on GTK password entry.
5f53fe
5f53fe
For an old bug:
5f53fe
https://bugzilla.redhat.com/show_bug.cgi?id=484643
5f53fe
Input method should be disabled on password entry for security reason.
5f53fe
5f53fe
BUG=none
5f53fe
TEST=manually with gtk-demo "Entry Buffer" example
5f53fe
5f53fe
Review URL: http://codereview.appspot.com/5319053
5f53fe
---
5f53fe
 client/gtk2/ibusimcontext.c |   13 +++++++++++++
5f53fe
 1 files changed, 13 insertions(+), 0 deletions(-)
5f53fe
5f53fe
diff --git a/client/gtk2/ibusimcontext.c b/client/gtk2/ibusimcontext.c
5f53fe
index 327a5d9..b6ca12e 100644
5f53fe
--- a/client/gtk2/ibusimcontext.c
5f53fe
+++ b/client/gtk2/ibusimcontext.c
5f53fe
@@ -734,6 +734,19 @@ ibus_im_context_focus_in (GtkIMContext *context)
5f53fe
     if (ibusimcontext->has_focus)
5f53fe
         return;
5f53fe
 
5f53fe
+    /* don't set focus on password entry */
5f53fe
+    if (ibusimcontext->client_window != NULL) {
5f53fe
+        GtkWidget *widget;
5f53fe
+
5f53fe
+        gdk_window_get_user_data (ibusimcontext->client_window,
5f53fe
+                                  (gpointer *)&widget);
5f53fe
+
5f53fe
+        if (GTK_IS_ENTRY (widget) &&
5f53fe
+            !gtk_entry_get_visibility (GTK_ENTRY (widget))) {
5f53fe
+            return;
5f53fe
+        }
5f53fe
+    }
5f53fe
+
5f53fe
     if (_focus_im_context != NULL) {
5f53fe
         g_assert (_focus_im_context != context);
5f53fe
         gtk_im_context_focus_out (_focus_im_context);
5f53fe
-- 
5f53fe
1.7.6.4
5f53fe
150c9e
From 02893693fc0a8692a6242b0be6dc8f09e14c1c54 Mon Sep 17 00:00:00 2001
5f53fe
From: fujiwarat <takao.fujiwara1@gmail.com>
150c9e
Date: Wed, 2 Nov 2011 14:17:50 +0900
5f53fe
Subject: [PATCH] Rerotate next/previous engines without global engine.
5f53fe
150c9e
BUG=http://code.google.com/p/ibus/issues/detail?id=1331
150c9e
TEST=Linux desktop
150c9e
150c9e
Review URL: http://codereview.appspot.com/5321067
5f53fe
---
be8953
 bus/ibusimpl.c |   31 ++++++++++++++++++++++++++++---
be8953
 1 files changed, 28 insertions(+), 3 deletions(-)
5f53fe
5f53fe
diff --git a/bus/ibusimpl.c b/bus/ibusimpl.c
be8953
index 0a4f3fb..059d660 100644
5f53fe
--- a/bus/ibusimpl.c
5f53fe
+++ b/bus/ibusimpl.c
5f53fe
@@ -1056,7 +1056,7 @@ bus_ibus_impl_context_request_rotate_engine_in_menu (BusIBusImpl     *ibus,
5f53fe
     BusEngineProxy *engine;
5f53fe
     IBusEngineDesc *desc;
5f53fe
     IBusEngineDesc *next_desc = NULL;
5f53fe
-    GList *p;
5f53fe
+    GList *p = NULL;
5f53fe
 
5f53fe
     engine = bus_input_context_get_engine (context);
5f53fe
     if (engine == NULL) {
be8953
@@ -1074,21 +1074,46 @@ bus_ibus_impl_context_request_rotate_engine_in_menu (BusIBusImpl     *ibus,
5f53fe
     if (p != NULL) {
5f53fe
         if (is_next) {
5f53fe
             p = p->next;
5f53fe
-        } else if (p->prev) {
5f53fe
+        } else {
5f53fe
             p = p->prev;
5f53fe
         }
5f53fe
     }
5f53fe
+
5f53fe
+    /* Rotate register_engine_list and engine_list. */
be8953
+    if (p == NULL && g_list_find (ibus->register_engine_list, desc) != NULL) {
be8953
+        if (is_next) {
be8953
+            p = ibus->engine_list;
be8953
+        } else {
be8953
+            p = g_list_last (ibus->engine_list);
be8953
+        }
5f53fe
+    }
5f53fe
+
5f53fe
     if (p == NULL) {
5f53fe
         p = g_list_find (ibus->engine_list, desc);
5f53fe
         if (p != NULL) {
5f53fe
             if (is_next) {
5f53fe
                 p = p->next;
5f53fe
-            } else if (p->prev) {
5f53fe
+            } else {
5f53fe
                 p = p->prev;
5f53fe
             }
5f53fe
         }
5f53fe
     }
5f53fe
 
be8953
+    /* Rerotate register_engine_list and engine_list. */
be8953
+    if (p == NULL && g_list_find (ibus->engine_list, desc) != NULL) {
be8953
+        if (is_next) {
be8953
+            p = ibus->register_engine_list;
be8953
+            if (p == NULL) {
be8953
+                p = ibus->engine_list;
be8953
+            }
be8953
+        } else {
be8953
+            p = g_list_last (ibus->register_engine_list);
be8953
+            if (p == NULL) {
be8953
+                p = g_list_last (ibus->engine_list);
be8953
+            }
5f53fe
+        }
5f53fe
+    }
5f53fe
+
5f53fe
     if (p != NULL) {
5f53fe
         next_desc = (IBusEngineDesc*) p->data;
5f53fe
     }
5f53fe
-- 
5f53fe
1.7.6.4
5f53fe
150c9e
From 613e01520f27a53c947fed476d99aeb8ae1ae39b Mon Sep 17 00:00:00 2001
150c9e
From: fujiwarat <takao.fujiwara1@gmail.com>
150c9e
Date: Tue, 8 Nov 2011 10:48:42 +0900
150c9e
Subject: [PATCH] Fixed fallback icons.
150c9e
150c9e
1. Set 'ibus-keyboard' icon for IME off in non-GNOME theme.
150c9e
People would think the application icon for non-GNONE classic desktop.
150c9e
The themed icon is applied for GNOME icon theme only.
150c9e
150c9e
2. Set gtk-fallback-icon-theme as 'gnome'
150c9e
ibus gtk panel needs gtk stock icons but some desktop does not load GNOME
150c9e
icon theme. I assigned 'gnome' for gtk-fallback-icon-theme if it's none.
150c9e
150c9e
3. Use 'gtk-dialog-info' if 'gtk-info' is not found.
150c9e
It seems the latest gtk2 does not have 'gtk-info' icon via pygtk2.
150c9e
150c9e
BUG=RH#711632
150c9e
TEST=Linux desktop
150c9e
150c9e
Review URL: http://codereview.appspot.com/5320066
150c9e
---
150c9e
 ibus/_config.py.in |    8 ++++++--
150c9e
 ui/gtk/main.py     |    3 +++
150c9e
 ui/gtk/panel.py    |    2 +-
150c9e
 3 files changed, 10 insertions(+), 3 deletions(-)
150c9e
150c9e
diff --git a/ibus/_config.py.in b/ibus/_config.py.in
150c9e
index a830136..098d805 100644
150c9e
--- a/ibus/_config.py.in
150c9e
+++ b/ibus/_config.py.in
150c9e
@@ -45,10 +45,14 @@ def get_license():
150c9e
 
150c9e
 def get_ICON_KEYBOARD():
150c9e
     import gtk
150c9e
-    theme = gtk.icon_theme_get_default()
150c9e
     icon = '@IBUS_ICON_KEYBOARD@'
150c9e
+    fallback_icon = 'ibus-keyboard'
150c9e
+    settings = gtk.settings_get_default()
150c9e
+    if settings.get_property('gtk-icon-theme-name') != 'gnome':
150c9e
+        return fallback_icon
150c9e
+    theme = gtk.icon_theme_get_default()
150c9e
     if not theme.lookup_icon(icon, 18, 0):
150c9e
-        icon = 'ibus-keyboard'
150c9e
+        return fallback_icon
150c9e
     return icon
150c9e
 
150c9e
 ISOCODES_PREFIX='@ISOCODES_PREFIX@'
150c9e
diff --git a/ui/gtk/main.py b/ui/gtk/main.py
150c9e
index 0412aea..cadcc96 100644
150c9e
--- a/ui/gtk/main.py
150c9e
+++ b/ui/gtk/main.py
150c9e
@@ -86,6 +86,9 @@ class UIApplication:
150c9e
             pass
150c9e
 
150c9e
 def launch_panel(replace):
150c9e
+    settings = gtk.settings_get_default()
150c9e
+    if settings.get_property('gtk-fallback-icon-theme') == None:
150c9e
+        settings.set_property('gtk-fallback-icon-theme', 'gnome')
150c9e
     # gtk.settings_get_default().props.gtk_theme_name = "/home/phuang/.themes/aud-Default/gtk-2.0/gtkrc"
150c9e
     # gtk.rc_parse("./themes/default/gtkrc")
150c9e
     UIApplication(replace).run()
150c9e
diff --git a/ui/gtk/panel.py b/ui/gtk/panel.py
150c9e
index 90be1d5..f71a36d 100644
150c9e
--- a/ui/gtk/panel.py
150c9e
+++ b/ui/gtk/panel.py
150c9e
@@ -477,7 +477,7 @@ class Panel(ibus.PanelBase):
150c9e
             menu = gtk.Menu()
150c9e
             item = gtk.ImageMenuItem(_("No input window"))
150c9e
             size = gtk.icon_size_lookup(gtk.ICON_SIZE_MENU)
150c9e
-            item.set_image(_icon.IconWidget("gtk-info", size[0]))
150c9e
+            item.set_image(_icon.IconWidget("gtk-dialog-info", size[0]))
150c9e
             menu.add(item)
150c9e
             menu.show_all()
150c9e
         else:
150c9e
-- 
150c9e
1.7.6.4
150c9e
150c9e
From c73b2d449e21ae0cb87845e34abadd2e54e1e423 Mon Sep 17 00:00:00 2001
481f2e
From: fujiwarat <takao.fujiwara1@gmail.com>
150c9e
Date: Mon, 21 Nov 2011 11:00:09 +0900
150c9e
Subject: [PATCH] Use ibus_input_context_process_key_event_async in
150c9e
 ibus-x11
481f2e
481f2e
---
150c9e
 client/x11/main.c |  113 ++++++++++++++++++++++++++++++++++++++++++++---------
150c9e
 1 files changed, 94 insertions(+), 19 deletions(-)
481f2e
481f2e
diff --git a/client/x11/main.c b/client/x11/main.c
150c9e
index 0ba826c..58069fc 100644
481f2e
--- a/client/x11/main.c
481f2e
+++ b/client/x11/main.c
481f2e
@@ -116,6 +116,8 @@ static gint     g_debug_level = 0;
481f2e
 
481f2e
 static IBusBus *_bus = NULL;
481f2e
 
481f2e
+static gboolean _use_sync_mode = FALSE;
481f2e
+
481f2e
 static void
481f2e
 _xim_preedit_start (XIMS xims, const X11IC *x11ic)
481f2e
 {
481f2e
@@ -443,6 +445,31 @@ xim_unset_ic_focus (XIMS xims, IMChangeFocusStruct *call_data)
481f2e
 
481f2e
 }
481f2e
 
481f2e
+static void
481f2e
+_process_key_event_done (GObject      *object,
481f2e
+                         GAsyncResult *res,
481f2e
+                         gpointer      user_data)
481f2e
+{
481f2e
+    IBusInputContext *context = (IBusInputContext *)object;
481f2e
+    IMForwardEventStruct *pfe = (IMForwardEventStruct*) user_data;
481f2e
+
481f2e
+    GError *error = NULL;
481f2e
+    gboolean retval = ibus_input_context_process_key_event_async_finish (
481f2e
+            context,
481f2e
+            res,
481f2e
+            &error);
481f2e
+
481f2e
+    if (error != NULL) {
481f2e
+        g_warning ("Process Key Event failed: %s.", error->message);
481f2e
+        g_error_free (error);
481f2e
+    }
481f2e
+
481f2e
+    if (retval == FALSE) {
481f2e
+        IMForwardEvent (_xims, (XPointer) pfe);
481f2e
+    }
150c9e
+    g_slice_free (IMForwardEventStruct, pfe);
481f2e
+}
481f2e
+
481f2e
 static int
481f2e
 xim_forward_event (XIMS xims, IMForwardEventStruct *call_data)
481f2e
 {
150c9e
@@ -469,30 +496,57 @@ xim_forward_event (XIMS xims, IMForwardEventStruct *call_data)
481f2e
     if (event.type == GDK_KEY_RELEASE) {
481f2e
         event.state |= IBUS_RELEASE_MASK;
481f2e
     }
481f2e
-    retval = ibus_input_context_process_key_event (x11ic->context,
481f2e
-                                                   event.keyval,
481f2e
-                                                   event.hardware_keycode - 8,
481f2e
-                                                   event.state);
481f2e
-    if (retval) {
481f2e
-        if (! x11ic->has_preedit_area) {
481f2e
-            _xim_set_cursor_location (x11ic);
481f2e
+
481f2e
+    if (_use_sync_mode) {
481f2e
+        retval = ibus_input_context_process_key_event (
481f2e
+                                      x11ic->context,
481f2e
+                                      event.keyval,
481f2e
+                                      event.hardware_keycode - 8,
481f2e
+                                      event.state);
481f2e
+        if (retval) {
481f2e
+            if (! x11ic->has_preedit_area) {
481f2e
+                _xim_set_cursor_location (x11ic);
481f2e
+            }
481f2e
+            return 1;
481f2e
         }
481f2e
-        return 1;
481f2e
-    }
481f2e
 
481f2e
-    IMForwardEventStruct fe;
481f2e
-    memset (&fe, 0, sizeof (fe));
481f2e
+        IMForwardEventStruct fe;
481f2e
+        memset (&fe, 0, sizeof (fe));
481f2e
 
481f2e
-    fe.major_code = XIM_FORWARD_EVENT;
481f2e
-    fe.icid = x11ic->icid;
481f2e
-    fe.connect_id = x11ic->connect_id;
481f2e
-    fe.sync_bit = 0;
481f2e
-    fe.serial_number = 0L;
481f2e
-    fe.event = call_data->event;
481f2e
+        fe.major_code = XIM_FORWARD_EVENT;
481f2e
+        fe.icid = x11ic->icid;
481f2e
+        fe.connect_id = x11ic->connect_id;
481f2e
+        fe.sync_bit = 0;
481f2e
+        fe.serial_number = 0L;
481f2e
+        fe.event = call_data->event;
481f2e
 
481f2e
-    IMForwardEvent (_xims, (XPointer) &fe);
481f2e
+        IMForwardEvent (_xims, (XPointer) &fe);
481f2e
 
481f2e
-    return 1;
481f2e
+        retval = 1;
481f2e
+    }
481f2e
+    else {
481f2e
+        IMForwardEventStruct *pfe;
481f2e
+
150c9e
+        pfe = g_slice_new0 (IMForwardEventStruct);
481f2e
+        pfe->major_code = XIM_FORWARD_EVENT;
481f2e
+        pfe->icid = x11ic->icid;
481f2e
+        pfe->connect_id = x11ic->connect_id;
481f2e
+        pfe->sync_bit = 0;
481f2e
+        pfe->serial_number = 0L;
150c9e
+        pfe->event = call_data->event;
481f2e
+
481f2e
+        ibus_input_context_process_key_event_async (
481f2e
+                                      x11ic->context,
481f2e
+                                      event.keyval,
481f2e
+                                      event.hardware_keycode - 8,
481f2e
+                                      event.state,
481f2e
+                                      -1,
481f2e
+                                      NULL,
481f2e
+                                      _process_key_event_done,
481f2e
+                                      pfe);
481f2e
+        retval = 1;
481f2e
+    }
481f2e
+    return retval;
481f2e
 }
481f2e
 
481f2e
 
150c9e
@@ -897,6 +951,25 @@ _context_disabled_cb (IBusInputContext *context,
481f2e
     _xim_preedit_end (_xims, x11ic);
481f2e
 }
481f2e
 
481f2e
+static gboolean
481f2e
+_get_boolean_env(const gchar *name,
481f2e
+                 gboolean     defval)
481f2e
+{
481f2e
+    const gchar *value = g_getenv (name);
481f2e
+
481f2e
+    if (value == NULL)
481f2e
+      return defval;
481f2e
+
481f2e
+    if (g_strcmp0 (value, "") == 0 ||
481f2e
+        g_strcmp0 (value, "0") == 0 ||
481f2e
+        g_strcmp0 (value, "false") == 0 ||
481f2e
+        g_strcmp0 (value, "False") == 0 ||
481f2e
+        g_strcmp0 (value, "FALSE") == 0)
481f2e
+      return FALSE;
481f2e
+
481f2e
+    return TRUE;
481f2e
+}
481f2e
+
481f2e
 static void
481f2e
 _init_ibus (void)
481f2e
 {
150c9e
@@ -909,6 +982,8 @@ _init_ibus (void)
481f2e
 
481f2e
     g_signal_connect (_bus, "disconnected",
481f2e
                         G_CALLBACK (_bus_disconnected_cb), NULL);
481f2e
+
481f2e
+    _use_sync_mode = _get_boolean_env ("IBUS_ENABLE_SYNC_MODE", FALSE);
481f2e
 }
481f2e
 
481f2e
 static void
481f2e
-- 
481f2e
1.7.6.4
481f2e
8ffe46
From 5d2ac19e1524b1802f5298eedff1ba52423c847f Mon Sep 17 00:00:00 2001
8ffe46
From: Daiki Ueno <ueno@unixuser.org>
8ffe46
Date: Wed, 30 Nov 2011 09:40:15 +0900
8ffe46
Subject: [PATCH] Disable surrounding-text when retrieve-surrounding
8ffe46
 signal is not handled in GTK.
8ffe46
8ffe46
BUG=https://code.google.com/p/ibus/issues/detail?id=1358
8ffe46
TEST=On Fedora with ibus-m17n tis820
8ffe46
8ffe46
Review URL: http://codereview.appspot.com/5431086
8ffe46
---
8ffe46
 client/gtk2/ibusimcontext.c |    5 +++++
8ffe46
 1 files changed, 5 insertions(+), 0 deletions(-)
8ffe46
8ffe46
diff --git a/client/gtk2/ibusimcontext.c b/client/gtk2/ibusimcontext.c
8ffe46
index b6ca12e..5ae5cfc 100644
8ffe46
--- a/client/gtk2/ibusimcontext.c
8ffe46
+++ b/client/gtk2/ibusimcontext.c
8ffe46
@@ -278,6 +278,11 @@ _request_surrounding_text (IBusIMContext *context)
8ffe46
         IDEBUG ("requesting surrounding text");
8ffe46
         g_signal_emit (context, _signal_retrieve_surrounding_id, 0,
8ffe46
                        &return_value);
8ffe46
+        if (!return_value) {
8ffe46
+            context->caps &= ~IBUS_CAP_SURROUNDING_TEXT;
8ffe46
+            ibus_input_context_set_capabilities (context->ibuscontext,
8ffe46
+                                                 context->caps);
8ffe46
+        }
8ffe46
     }
8ffe46
 }
8ffe46
 
8ffe46
-- 
8ffe46
1.7.6.4
8ffe46
8ffe46
From 5236e2159f2e6184c18df9a9ecbb05bfb09106d4 Mon Sep 17 00:00:00 2001
150c9e
From: fujiwarat <takao.fujiwara1@gmail.com>
8ffe46
Date: Wed, 30 Nov 2011 12:28:22 +0900
150c9e
Subject: [PATCH] Add the engine preference button on ibus-setup
150c9e
150c9e
The new preference button launches $libexecdir/ibus-setup- + engine.name
150c9e
by default. The engine is IBusEngineDesc.
150c9e
If engine.setup has a value, the button launches it instead.
8ffe46
8ffe46
BUG=RH#618229
8ffe46
TEST=Linux desktop
8ffe46
8ffe46
Review URL: http://codereview.appspot.com/5437062
150c9e
---
150c9e
 ibus/enginedesc.py   |   11 +++++++++--
150c9e
 setup/ibus-setup.in  |    2 ++
150c9e
 setup/main.py        |   46 ++++++++++++++++++++++++++++++++++++++++++++++
150c9e
 setup/setup.ui       |   16 ++++++++++++++++
150c9e
 src/ibusenginedesc.c |   31 +++++++++++++++++++++++++++++++
150c9e
 src/ibusenginedesc.h |   12 ++++++++++--
150c9e
 6 files changed, 114 insertions(+), 4 deletions(-)
150c9e
150c9e
diff --git a/ibus/enginedesc.py b/ibus/enginedesc.py
150c9e
index 3ca7f24..055a3a0 100644
150c9e
--- a/ibus/enginedesc.py
150c9e
+++ b/ibus/enginedesc.py
150c9e
@@ -31,7 +31,7 @@ from serializable import *
150c9e
 class EngineDesc(Serializable):
150c9e
     __gtype_name__ = "PYIBusEngineDesc"
150c9e
     __NAME__ = "IBusEngineDesc"
150c9e
-    def __init__(self, name="", longname="", description="", language="", license="", author="", icon="", layout="", hotkeys="", rank=0, symbol=""):
150c9e
+    def __init__(self, name="", longname="", description="", language="", license="", author="", icon="", layout="", hotkeys="", rank=0, symbol="", setup=""):
150c9e
         super(EngineDesc, self).__init__()
150c9e
         self.__name = name
150c9e
         self.__longname = longname
150c9e
@@ -44,6 +44,7 @@ class EngineDesc(Serializable):
150c9e
         self.__rank = rank
150c9e
         self.__hotkeys = hotkeys
150c9e
         self.__symbol = symbol
150c9e
+        self.__setup = setup
150c9e
 
150c9e
     def get_name(self):
150c9e
         return self.__name
150c9e
@@ -78,6 +79,9 @@ class EngineDesc(Serializable):
150c9e
     def get_symbol(self):
150c9e
         return self.__symbol
150c9e
 
150c9e
+    def get_setup(self):
150c9e
+        return self.__setup
150c9e
+
150c9e
     name        = property(get_name)
150c9e
     longname    = property(get_longname)
150c9e
     description = property(get_description)
150c9e
@@ -89,6 +93,7 @@ class EngineDesc(Serializable):
150c9e
     rank        = property(get_rank)
150c9e
     hotkeys     = property(get_hotkeys)
150c9e
     symbol      = property(get_symbol)
150c9e
+    setup       = property(get_setup)
150c9e
 
150c9e
     def serialize(self, struct):
150c9e
         super(EngineDesc, self).serialize(struct)
150c9e
@@ -103,6 +108,7 @@ class EngineDesc(Serializable):
150c9e
         struct.append(dbus.UInt32(self.__rank))
150c9e
         struct.append(dbus.String(self.__hotkeys))
150c9e
         struct.append(dbus.String(self.__symbol))
150c9e
+        struct.append(dbus.String(self.__setup))
150c9e
 
150c9e
     def deserialize(self, struct):
150c9e
         super(EngineDesc, self).deserialize(struct)
150c9e
@@ -117,9 +123,10 @@ class EngineDesc(Serializable):
150c9e
         self.__rank = struct.pop(0)
150c9e
         self.__hotkeys = struct.pop(0)
150c9e
         self.__symbol = struct.pop(0)
150c9e
+        self.__setup  = struct.pop(0)
150c9e
 
150c9e
 def test():
150c9e
-    engine = EngineDesc("Hello", "", "", "", "", "", "", "", "", 0, "")
150c9e
+    engine = EngineDesc("Hello", "", "", "", "", "", "", "", "", 0, "", "")
150c9e
     value = serialize_object(engine)
150c9e
     engine = deserialize_object(value)
150c9e
 
150c9e
diff --git a/setup/ibus-setup.in b/setup/ibus-setup.in
150c9e
index 72bc1a4..f3c3730 100644
150c9e
--- a/setup/ibus-setup.in
150c9e
+++ b/setup/ibus-setup.in
150c9e
@@ -23,8 +23,10 @@
150c9e
 prefix=@prefix@
150c9e
 exec_prefix=@exec_prefix@
150c9e
 datarootdir=@datarootdir@
150c9e
+libexecdir=@libexecdir@
150c9e
 export IBUS_PREFIX=@prefix@
150c9e
 export IBUS_DATAROOTDIR=@datarootdir@
150c9e
 export IBUS_LOCALEDIR=@localedir@
150c9e
+export IBUS_LIBEXECDIR=${libexecdir}
150c9e
 exec @PYTHON@ @prefix@/share/ibus/setup/main.py $@
150c9e
 
150c9e
diff --git a/setup/main.py b/setup/main.py
150c9e
index a22bb0c..6c0fb0e 100644
150c9e
--- a/setup/main.py
150c9e
+++ b/setup/main.py
150c9e
@@ -238,6 +238,10 @@ class Setup(object):
150c9e
         button = self.__builder.get_object("button_engine_about")
150c9e
         button.connect("clicked", self.__button_engine_about_cb)
150c9e
 
150c9e
+        self.__engine_setup_exec_list = {}
150c9e
+        button = self.__builder.get_object("button_engine_preferences")
150c9e
+        button.connect("clicked", self.__button_engine_preferences_cb)
150c9e
+
150c9e
         self.__combobox.connect("notify::active-engine", self.__combobox_notify_active_engine_cb)
150c9e
         self.__treeview.connect("notify", self.__treeview_notify_cb)
150c9e
 
150c9e
@@ -246,6 +250,24 @@ class Setup(object):
150c9e
         button = self.__builder.get_object("button_engine_add")
150c9e
         button.set_sensitive(engine != None and engine not in self.__treeview.get_engines())
150c9e
 
150c9e
+    def __get_engine_setup_exec_args(self, engine):
150c9e
+        args = []
150c9e
+        if engine == None:
150c9e
+           return args
150c9e
+        setup = str(engine.setup)
150c9e
+        if len(setup) != 0:
150c9e
+            args = setup.split()
150c9e
+            args.insert(1, path.basename(args[0]))
150c9e
+            return args
150c9e
+        name = str(engine.name)
150c9e
+        libexecdir = os.environ['IBUS_LIBEXECDIR']
150c9e
+        setup_path = (libexecdir + '/' + 'ibus-setup-' if libexecdir != None \
150c9e
+            else 'ibus-setup-') + name.split(':')[0]
150c9e
+        if path.exists(setup_path):
150c9e
+            args.append(setup_path)
150c9e
+            args.append(path.basename(setup_path))
150c9e
+        return args
150c9e
+
150c9e
     def __treeview_notify_cb(self, treeview, property):
150c9e
         if property.name != "active-engine" and property.name != "engines":
150c9e
             return
150c9e
@@ -258,6 +280,12 @@ class Setup(object):
150c9e
         self.__builder.get_object("button_engine_up").set_sensitive(engine not in engines[:1])
150c9e
         self.__builder.get_object("button_engine_down").set_sensitive(engine not in engines[-1:])
150c9e
 
150c9e
+        obj = self.__builder.get_object("button_engine_preferences")
150c9e
+        if len(self.__get_engine_setup_exec_args(engine)) != 0:
150c9e
+            obj.set_sensitive(True)
150c9e
+        else:
150c9e
+            obj.set_sensitive(False)
150c9e
+
150c9e
         if property.name == "engines":
150c9e
             engine_names = map(lambda e: e.name, engines)
150c9e
             self.__config.set_list("general", "preload_engines", engine_names, "s")
150c9e
@@ -273,6 +301,24 @@ class Setup(object):
150c9e
             about.run()
150c9e
             about.destroy()
150c9e
 
150c9e
+    def __button_engine_preferences_cb(self, button):
150c9e
+        engine = self.__treeview.get_active_engine()
150c9e
+        args = self.__get_engine_setup_exec_args(engine)
150c9e
+        if len(args) == 0:
150c9e
+            return
150c9e
+        name = engine.name
150c9e
+        if name in self.__engine_setup_exec_list.keys():
150c9e
+            try:
150c9e
+                wpid, sts = os.waitpid(self.__engine_setup_exec_list[name],
150c9e
+                                       os.WNOHANG)
150c9e
+                # the setup is still running.
150c9e
+                if wpid == 0:
150c9e
+                    return
150c9e
+            except OSError:
150c9e
+                pass
150c9e
+            del self.__engine_setup_exec_list[name]
150c9e
+        self.__engine_setup_exec_list[name] = os.spawnl(os.P_NOWAIT, *args)
150c9e
+
150c9e
     def __init_bus(self):
150c9e
         try:
150c9e
             self.__bus = ibus.Bus()
150c9e
diff --git a/setup/setup.ui b/setup/setup.ui
150c9e
index 0a69df8..c7ff564 100644
150c9e
--- a/setup/setup.ui
150c9e
+++ b/setup/setup.ui
150c9e
@@ -726,6 +726,22 @@
150c9e
                                     <property name="position">4</property>
150c9e
                                   </packing>
150c9e
                                 </child>
150c9e
+                                <child>
150c9e
+                                  <object class="GtkButton" id="button_engine_preferences">
150c9e
+                                    <property name="label">gtk-preferences</property>
150c9e
+                                    <property name="visible">True</property>
150c9e
+                                    <property name="sensitive">False</property>
150c9e
+                                    <property name="can_focus">True</property>
150c9e
+                                    <property name="receives_default">True</property>
150c9e
+                                    <property name="tooltip_text" translatable="yes">Show setup of the selected input method</property>
150c9e
+                                    <property name="use_stock">True</property>
150c9e
+                                  </object>
150c9e
+                                  <packing>
150c9e
+                                    <property name="expand">False</property>
150c9e
+                                    <property name="fill">False</property>
150c9e
+                                    <property name="position">5</property>
150c9e
+                                  </packing>
150c9e
+                                </child>
150c9e
                               </object>
150c9e
                             </child>
150c9e
                           </object>
150c9e
diff --git a/src/ibusenginedesc.c b/src/ibusenginedesc.c
150c9e
index fa3a768..48ecb07 100644
150c9e
--- a/src/ibusenginedesc.c
150c9e
+++ b/src/ibusenginedesc.c
150c9e
@@ -40,6 +40,7 @@ enum {
150c9e
     PROP_RANK,
150c9e
     PROP_HOTKEYS,
150c9e
     PROP_SYMBOL,
150c9e
+    PROP_SETUP,
150c9e
 };
150c9e
 
150c9e
 
150c9e
@@ -56,6 +57,7 @@ struct _IBusEngineDescPrivate {
150c9e
     guint       rank;
150c9e
     gchar      *hotkeys;
150c9e
     gchar      *symbol;
150c9e
+    gchar      *setup;
150c9e
 };
150c9e
 
150c9e
 #define IBUS_ENGINE_DESC_GET_PRIVATE(o)  \
150c9e
@@ -247,6 +249,19 @@ ibus_engine_desc_class_init (IBusEngineDescClass *class)
150c9e
                         "The icon symbol chars of engine description",
150c9e
                         "",
150c9e
                         G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
150c9e
+
150c9e
+    /**
150c9e
+     * IBusEngineDesc:setup:
150c9e
+     *
150c9e
+     * The exec lists of the engine setup command
150c9e
+     */
150c9e
+    g_object_class_install_property (gobject_class,
150c9e
+                    PROP_SETUP,
150c9e
+                    g_param_spec_string ("setup",
150c9e
+                        "setup args",
150c9e
+                        "The exec lists of the engine setup command",
150c9e
+                        "",
150c9e
+                        G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
150c9e
 }
150c9e
 
150c9e
 static void
150c9e
@@ -265,6 +280,7 @@ ibus_engine_desc_init (IBusEngineDesc *desc)
150c9e
     desc->priv->rank = 0;
150c9e
     desc->priv->hotkeys = NULL;
150c9e
     desc->priv->symbol = NULL;
150c9e
+    desc->priv->setup = NULL;
150c9e
 }
150c9e
 
150c9e
 static void
150c9e
@@ -280,6 +296,7 @@ ibus_engine_desc_destroy (IBusEngineDesc *desc)
150c9e
     g_free (desc->priv->layout);
150c9e
     g_free (desc->priv->hotkeys);
150c9e
     g_free (desc->priv->symbol);
150c9e
+    g_free (desc->priv->setup);
150c9e
 
150c9e
     IBUS_OBJECT_CLASS (ibus_engine_desc_parent_class)->destroy (IBUS_OBJECT (desc));
150c9e
 }
150c9e
@@ -334,6 +351,10 @@ ibus_engine_desc_set_property (IBusEngineDesc *desc,
150c9e
         g_assert (desc->priv->symbol == NULL);
150c9e
         desc->priv->symbol = g_value_dup_string (value);
150c9e
         break;
150c9e
+    case PROP_SETUP:
150c9e
+        g_assert (desc->priv->setup == NULL);
150c9e
+        desc->priv->setup = g_value_dup_string (value);
150c9e
+        break;
150c9e
     default:
150c9e
         G_OBJECT_WARN_INVALID_PROPERTY_ID (desc, prop_id, pspec);
150c9e
     }
150c9e
@@ -379,6 +400,9 @@ ibus_engine_desc_get_property (IBusEngineDesc *desc,
150c9e
     case PROP_SYMBOL:
150c9e
         g_value_set_string (value, ibus_engine_desc_get_symbol (desc));
150c9e
         break;
150c9e
+    case PROP_SETUP:
150c9e
+        g_value_set_string (value, ibus_engine_desc_get_setup (desc));
150c9e
+        break;
150c9e
     default:
150c9e
         G_OBJECT_WARN_INVALID_PROPERTY_ID (desc, prop_id, pspec);
150c9e
     }
150c9e
@@ -410,6 +434,7 @@ ibus_engine_desc_serialize (IBusEngineDesc  *desc,
150c9e
     g_variant_builder_add (builder, "u", desc->priv->rank);
150c9e
     g_variant_builder_add (builder, "s", NOTNULL (desc->priv->hotkeys));
150c9e
     g_variant_builder_add (builder, "s", NOTNULL (desc->priv->symbol));
150c9e
+    g_variant_builder_add (builder, "s", NOTNULL (desc->priv->setup));
150c9e
 #undef NOTNULL
150c9e
 
150c9e
     return TRUE;
150c9e
@@ -439,6 +464,7 @@ ibus_engine_desc_deserialize (IBusEngineDesc *desc,
150c9e
     g_variant_get_child (variant, retval++, "u", &desc->priv->rank);
150c9e
     g_variant_get_child (variant, retval++, "s", &desc->priv->hotkeys);
150c9e
     g_variant_get_child (variant, retval++, "s", &desc->priv->symbol);
150c9e
+    g_variant_get_child (variant, retval++, "s", &desc->priv->setup);
150c9e
 
150c9e
     return retval;
150c9e
 }
150c9e
@@ -464,6 +490,7 @@ ibus_engine_desc_copy (IBusEngineDesc       *dest,
150c9e
     dest->priv->rank             = src->priv->rank;
150c9e
     dest->priv->hotkeys          = g_strdup (src->priv->hotkeys);
150c9e
     dest->priv->symbol           = g_strdup (src->priv->symbol);
150c9e
+    dest->priv->setup            = g_strdup (src->priv->setup);
150c9e
     return TRUE;
150c9e
 }
150c9e
 
150c9e
@@ -502,6 +529,7 @@ ibus_engine_desc_output (IBusEngineDesc *desc,
150c9e
     OUTPUT_ENTRY_1(layout);
150c9e
     OUTPUT_ENTRY_1(hotkeys);
150c9e
     OUTPUT_ENTRY_1(symbol);
150c9e
+    OUTPUT_ENTRY_1(setup);
150c9e
     g_string_append_indent (output, indent + 1);
150c9e
     g_string_append_printf (output, "<rank>%u</rank>\n", desc->priv->rank);
150c9e
 #undef OUTPUT_ENTRY
150c9e
@@ -536,6 +564,7 @@ ibus_engine_desc_parse_xml_node (IBusEngineDesc *desc,
150c9e
         PARSE_ENTRY_1(layout);
150c9e
         PARSE_ENTRY_1(hotkeys);
150c9e
         PARSE_ENTRY_1(symbol);
150c9e
+        PARSE_ENTRY_1(setup);
150c9e
 #undef PARSE_ENTRY
150c9e
 #undef PARSE_ENTRY_1
150c9e
         if (g_strcmp0 (sub_node->name , "rank") == 0) {
150c9e
@@ -565,6 +594,7 @@ IBUS_ENGINE_DESC_GET_PROPERTY (layout, const gchar *)
150c9e
 IBUS_ENGINE_DESC_GET_PROPERTY (rank, guint)
150c9e
 IBUS_ENGINE_DESC_GET_PROPERTY (hotkeys, const gchar *)
150c9e
 IBUS_ENGINE_DESC_GET_PROPERTY (symbol, const gchar *)
150c9e
+IBUS_ENGINE_DESC_GET_PROPERTY (setup, const gchar *)
150c9e
 #undef IBUS_ENGINE_DESC_GET_PROPERTY
150c9e
 
150c9e
 IBusEngineDesc *
150c9e
@@ -613,6 +643,7 @@ ibus_engine_desc_new_varargs (const gchar *first_property_name, ...)
150c9e
     g_assert (desc->priv->layout);
150c9e
     g_assert (desc->priv->hotkeys);
150c9e
     g_assert (desc->priv->symbol);
150c9e
+    g_assert (desc->priv->setup);
150c9e
 
150c9e
     return desc;
150c9e
 }
150c9e
diff --git a/src/ibusenginedesc.h b/src/ibusenginedesc.h
150c9e
index 76a7adc..928743e 100644
150c9e
--- a/src/ibusenginedesc.h
150c9e
+++ b/src/ibusenginedesc.h
150c9e
@@ -255,8 +255,16 @@ const gchar     *ibus_engine_desc_get_hotkeys   (IBusEngineDesc *info);
150c9e
  *
150c9e
  * Return the symbol property in IBusEngineDesc. It should not be freed.
150c9e
  */
150c9e
-const gchar     *ibus_engine_desc_get_symbol
150c9e
-                                                (IBusEngineDesc *info);
150c9e
+const gchar     *ibus_engine_desc_get_symbol    (IBusEngineDesc *info);
150c9e
+
150c9e
+/**
150c9e
+ * ibus_engine_desc_get_setup:
150c9e
+ * @info: An IBusEngineDesc
150c9e
+ * @returns: setup property in IBusEngineDesc
150c9e
+ *
150c9e
+ * Return the setup property in IBusEngineDesc. It should not be freed.
150c9e
+ */
150c9e
+const gchar     *ibus_engine_desc_get_setup     (IBusEngineDesc *info);
150c9e
 
150c9e
 /**
150c9e
  * ibus_engine_desc_output:
150c9e
-- 
150c9e
1.7.6.4
150c9e
8ffe46
From fd07a5a761fe1c242ba8babaab1060d5679a3618 Mon Sep 17 00:00:00 2001
8ffe46
From: fujiwarat <takao.fujiwara1@gmail.com>
8ffe46
Date: Tue, 20 Dec 2011 13:46:45 +0900
8ffe46
Subject: [PATCH] Fix a SEGV if ibusimcontext->ibuscontext is null.
8ffe46
8ffe46
BUG=
8ffe46
TEST=Linux desktop
8ffe46
8ffe46
Review URL: http://codereview.appspot.com/5489086
8ffe46
---
8ffe46
 client/gtk2/ibusimcontext.c |    1 +
8ffe46
 1 files changed, 1 insertions(+), 0 deletions(-)
8ffe46
8ffe46
diff --git a/client/gtk2/ibusimcontext.c b/client/gtk2/ibusimcontext.c
8ffe46
index 5ae5cfc..72db581 100644
8ffe46
--- a/client/gtk2/ibusimcontext.c
8ffe46
+++ b/client/gtk2/ibusimcontext.c
8ffe46
@@ -273,6 +273,7 @@ _request_surrounding_text (IBusIMContext *context)
8ffe46
 {
8ffe46
     if (context && context->enable &&
8ffe46
         (context->caps & IBUS_CAP_SURROUNDING_TEXT) != 0 &&
8ffe46
+        context->ibuscontext != NULL &&
8ffe46
         ibus_input_context_needs_surrounding_text (context->ibuscontext)) {
8ffe46
         gboolean return_value;
8ffe46
         IDEBUG ("requesting surrounding text");
8ffe46
-- 
8ffe46
1.7.7
8ffe46
8ffe46
From ee9c4fba4535e85bd1f02743cab8914dd84e6178 Mon Sep 17 00:00:00 2001
8ffe46
From: Peng Huang <shawn.p.huang@gmail.com>
8ffe46
Date: Thu, 22 Dec 2011 09:57:01 -0500
8ffe46
Subject: [PATCH] Make all fields of IBusProperty as gobject property.
8ffe46
8ffe46
BUG=http://code.google.com/p/ibus/issues/detail?id=1383
8ffe46
TEST=Linux desktop
8ffe46
8ffe46
Review URL: http://codereview.appspot.com/5500066
8ffe46
---
8ffe46
 src/ibusproperty.c |  471 +++++++++++++++++++++++++++++++++++++++------------
8ffe46
 src/ibusproperty.h |   41 ++---
8ffe46
 2 files changed, 376 insertions(+), 136 deletions(-)
8ffe46
8ffe46
diff --git a/src/ibusproperty.c b/src/ibusproperty.c
8ffe46
index 5a2dd78..e5480fa 100644
8ffe46
--- a/src/ibusproperty.c
8ffe46
+++ b/src/ibusproperty.c
8ffe46
@@ -21,8 +21,52 @@
8ffe46
  */
8ffe46
 #include "ibusproperty.h"
8ffe46
 #include "ibusproplist.h"
8ffe46
+#include "ibusenumtypes.h"
8ffe46
+
8ffe46
+enum {
8ffe46
+    LAST_SIGNAL,
8ffe46
+};
8ffe46
+
8ffe46
+enum {
8ffe46
+    PROP_0 = 0,
8ffe46
+    PROP_KEY,
8ffe46
+    PROP_ICON,
8ffe46
+    PROP_LABEL,
8ffe46
+    PROP_TOOLTIP,
8ffe46
+    PROP_SENSITIVE,
8ffe46
+    PROP_VISIBLE,
8ffe46
+    PROP_PROP_TYPE,
8ffe46
+    PROP_STATE,
8ffe46
+    PROP_SUB_PROPS,
8ffe46
+};
8ffe46
+
8ffe46
+/* _IBusPropertyPrivate */
8ffe46
+struct _IBusPropertyPrivate {
8ffe46
+    gchar    *key;
8ffe46
+    gchar    *icon;
8ffe46
+    IBusText *label;
8ffe46
+    IBusText *tooltip;
8ffe46
+
8ffe46
+    gboolean sensitive;
8ffe46
+    gboolean visible;
8ffe46
+    IBusPropType type;
8ffe46
+    IBusPropState state;
8ffe46
+
8ffe46
+    IBusPropList *sub_props;
8ffe46
+};
8ffe46
+
8ffe46
+#define IBUS_PROPERTY_GET_PRIVATE(o)  \
8ffe46
+   (G_TYPE_INSTANCE_GET_PRIVATE ((o), IBUS_TYPE_PROPERTY, IBusPropertyPrivate))
8ffe46
 
8ffe46
 /* functions prototype */
8ffe46
+static void         ibus_property_set_property  (IBusProperty       *prop,
8ffe46
+                                                 guint               prop_id,
8ffe46
+                                                 const GValue       *value,
8ffe46
+                                                 GParamSpec         *pspec);
8ffe46
+static void         ibus_property_get_property  (IBusProperty       *prop,
8ffe46
+                                                 guint               prop_id,
8ffe46
+                                                 GValue             *value,
8ffe46
+                                                 GParamSpec         *pspec);
8ffe46
 static void         ibus_property_destroy       (IBusProperty       *prop);
8ffe46
 static gboolean     ibus_property_serialize     (IBusProperty       *prop,
8ffe46
                                                  GVariantBuilder    *builder);
8ffe46
@@ -36,53 +80,253 @@ G_DEFINE_TYPE (IBusProperty, ibus_property, IBUS_TYPE_SERIALIZABLE)
8ffe46
 static void
8ffe46
 ibus_property_class_init (IBusPropertyClass *class)
8ffe46
 {
8ffe46
+    GObjectClass *gobject_class = G_OBJECT_CLASS (class);
8ffe46
     IBusObjectClass *object_class = IBUS_OBJECT_CLASS (class);
8ffe46
     IBusSerializableClass *serializable_class = IBUS_SERIALIZABLE_CLASS (class);
8ffe46
 
8ffe46
+    g_type_class_add_private (class, sizeof (IBusPropertyPrivate));
8ffe46
+
8ffe46
+    gobject_class->set_property = (GObjectSetPropertyFunc) ibus_property_set_property;
8ffe46
+    gobject_class->get_property = (GObjectGetPropertyFunc) ibus_property_get_property;
8ffe46
+
8ffe46
     object_class->destroy = (IBusObjectDestroyFunc) ibus_property_destroy;
8ffe46
 
8ffe46
     serializable_class->serialize   = (IBusSerializableSerializeFunc) ibus_property_serialize;
8ffe46
     serializable_class->deserialize = (IBusSerializableDeserializeFunc) ibus_property_deserialize;
8ffe46
     serializable_class->copy        = (IBusSerializableCopyFunc) ibus_property_copy;
8ffe46
+
8ffe46
+    /* install properties */
8ffe46
+    /**
8ffe46
+     * IBusPropert:key:
8ffe46
+     *
8ffe46
+     * The key of property
8ffe46
+     */
8ffe46
+    g_object_class_install_property (gobject_class,
8ffe46
+            PROP_KEY,
8ffe46
+            g_param_spec_string ("key",
8ffe46
+                    "key",
8ffe46
+                    "The key of property",
8ffe46
+                    "",
8ffe46
+                    G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
8ffe46
+
8ffe46
+    /**
8ffe46
+     * IBusPropert:icon:
8ffe46
+     *
8ffe46
+     * The icon of property
8ffe46
+     */
8ffe46
+    g_object_class_install_property (gobject_class,
8ffe46
+            PROP_ICON,
8ffe46
+            g_param_spec_string ("icon",
8ffe46
+                    "icon",
8ffe46
+                    "The icon of property",
8ffe46
+                    "",
8ffe46
+                    G_PARAM_READWRITE));
8ffe46
+
8ffe46
+    /**
8ffe46
+     * IBusPropert:label:
8ffe46
+     *
8ffe46
+     * The label of property
8ffe46
+     */
8ffe46
+    g_object_class_install_property (gobject_class,
8ffe46
+            PROP_LABEL,
8ffe46
+            g_param_spec_object("label",
8ffe46
+                    "label",
8ffe46
+                    "The label of property",
8ffe46
+                    IBUS_TYPE_TEXT,
8ffe46
+                    G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
8ffe46
+
8ffe46
+    /**
8ffe46
+     * IBusPropert:tooltip:
8ffe46
+     *
8ffe46
+     * The tooltip of property
8ffe46
+     */
8ffe46
+    g_object_class_install_property (gobject_class,
8ffe46
+            PROP_TOOLTIP,
8ffe46
+            g_param_spec_object("tooltip",
8ffe46
+                    "tooltip",
8ffe46
+                    "The tooltip of property",
8ffe46
+                    IBUS_TYPE_TEXT,
8ffe46
+                    G_PARAM_READWRITE));
8ffe46
+
8ffe46
+    /**
8ffe46
+     * IBusPropert:sensitive:
8ffe46
+     *
8ffe46
+     * The sensitive of property
8ffe46
+     */
8ffe46
+    g_object_class_install_property (gobject_class,
8ffe46
+            PROP_SENSITIVE,
8ffe46
+            g_param_spec_boolean("sensitive",
8ffe46
+                    "sensitive",
8ffe46
+                    "The sensitive of property",
8ffe46
+                    TRUE,
8ffe46
+                    G_PARAM_READWRITE));
8ffe46
+
8ffe46
+    /**
8ffe46
+     * IBusPropert:visible:
8ffe46
+     *
8ffe46
+     * The visible of property
8ffe46
+     */
8ffe46
+    g_object_class_install_property (gobject_class,
8ffe46
+            PROP_VISIBLE,
8ffe46
+            g_param_spec_boolean("visible",
8ffe46
+                    "visible",
8ffe46
+                    "The visible of property",
8ffe46
+                    TRUE,
8ffe46
+                    G_PARAM_READWRITE));
8ffe46
+
8ffe46
+    /**
8ffe46
+     * IBusPropert:type:
8ffe46
+     *
8ffe46
+     * The type of property
8ffe46
+     */
8ffe46
+    g_object_class_install_property (gobject_class,
8ffe46
+            PROP_PROP_TYPE,
8ffe46
+            g_param_spec_enum("prop-type",
8ffe46
+                    "prop-type",
8ffe46
+                    "The type of property",
8ffe46
+                    IBUS_TYPE_PROP_TYPE,
8ffe46
+                    PROP_TYPE_NORMAL,
8ffe46
+                    G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
8ffe46
+    /**
8ffe46
+     * IBusPropert:state:
8ffe46
+     *
8ffe46
+     * The state of property
8ffe46
+     */
8ffe46
+    g_object_class_install_property (gobject_class,
8ffe46
+            PROP_STATE,
8ffe46
+            g_param_spec_enum("state",
8ffe46
+                    "state",
8ffe46
+                    "The state of property",
8ffe46
+                    IBUS_TYPE_PROP_STATE,
8ffe46
+                    PROP_STATE_UNCHECKED,
8ffe46
+                    G_PARAM_READWRITE));
8ffe46
+
8ffe46
+    /**
8ffe46
+     * IBusPropert:sub-props:
8ffe46
+     *
8ffe46
+     * The sub properties of property
8ffe46
+     */
8ffe46
+    g_object_class_install_property (gobject_class,
8ffe46
+            PROP_SUB_PROPS,
8ffe46
+            g_param_spec_object("sub-props",
8ffe46
+                    "sub properties",
8ffe46
+                    "The sub properties of property",
8ffe46
+                    IBUS_TYPE_PROP_LIST,
8ffe46
+                    G_PARAM_READWRITE));
8ffe46
 }
8ffe46
 
8ffe46
 static void
8ffe46
 ibus_property_init (IBusProperty *prop)
8ffe46
 {
8ffe46
-    prop->key = NULL;
8ffe46
-    prop->type = 0;
8ffe46
-    prop->label = NULL;
8ffe46
-    prop->icon = NULL;
8ffe46
-    prop->tooltip = NULL;
8ffe46
-    prop->sensitive = FALSE;
8ffe46
-    prop->visible = FALSE;
8ffe46
-    prop->state = 0;
8ffe46
-
8ffe46
-    prop->sub_props = NULL;
8ffe46
+    prop->priv = IBUS_PROPERTY_GET_PRIVATE (prop);
8ffe46
+
8ffe46
+    ibus_property_set_label (prop, NULL);
8ffe46
+    ibus_property_set_tooltip (prop, NULL);
8ffe46
+    ibus_property_set_sub_props (prop, NULL);
8ffe46
+
8ffe46
+}
8ffe46
+static void
8ffe46
+ibus_property_set_property (IBusProperty *prop,
8ffe46
+                            guint         prop_id,
8ffe46
+                            const GValue *value,
8ffe46
+                            GParamSpec   *pspec)
8ffe46
+{
8ffe46
+    switch (prop_id) {
8ffe46
+    case PROP_KEY:
8ffe46
+        g_assert (prop->priv->key == NULL);
8ffe46
+        prop->priv->key = g_value_dup_string (value);
8ffe46
+        break;
8ffe46
+    case PROP_ICON:
8ffe46
+        ibus_property_set_icon (prop, g_value_get_string (value));
8ffe46
+        break;
8ffe46
+    case PROP_LABEL:
8ffe46
+        ibus_property_set_label (prop, g_value_get_object (value));
8ffe46
+        break;
8ffe46
+    case PROP_TOOLTIP:
8ffe46
+        ibus_property_set_tooltip (prop, g_value_get_object (value));
8ffe46
+        break;
8ffe46
+    case PROP_SENSITIVE:
8ffe46
+        ibus_property_set_sensitive (prop, g_value_get_boolean (value));
8ffe46
+        break;
8ffe46
+    case PROP_VISIBLE:
8ffe46
+        ibus_property_set_visible (prop, g_value_get_boolean (value));
8ffe46
+        break;
8ffe46
+    case PROP_PROP_TYPE:
8ffe46
+        prop->priv->type = g_value_get_enum (value);
8ffe46
+        break;
8ffe46
+    case PROP_STATE:
8ffe46
+        ibus_property_set_state (prop, g_value_get_enum (value));
8ffe46
+        break;
8ffe46
+    case PROP_SUB_PROPS:
8ffe46
+        ibus_property_set_sub_props (prop,
8ffe46
+                (IBusPropList *)g_value_get_object (value));
8ffe46
+        break;
8ffe46
+    default:
8ffe46
+        G_OBJECT_WARN_INVALID_PROPERTY_ID (prop, prop_id, pspec);
8ffe46
+    }
8ffe46
+}
8ffe46
+
8ffe46
+static void
8ffe46
+ibus_property_get_property (IBusProperty *prop,
8ffe46
+                            guint         prop_id,
8ffe46
+                            GValue       *value,
8ffe46
+                            GParamSpec   *pspec)
8ffe46
+{
8ffe46
+    switch (prop_id) {
8ffe46
+    case PROP_KEY:
8ffe46
+        g_value_set_string (value, ibus_property_get_key (prop));
8ffe46
+        break;
8ffe46
+    case PROP_ICON:
8ffe46
+        g_value_set_string (value, ibus_property_get_icon (prop));
8ffe46
+        break;
8ffe46
+    case PROP_LABEL:
8ffe46
+        g_value_set_object (value, ibus_property_get_label (prop));
8ffe46
+        break;
8ffe46
+    case PROP_TOOLTIP:
8ffe46
+        g_value_set_object (value, ibus_property_get_tooltip (prop));
8ffe46
+        break;
8ffe46
+    case PROP_SENSITIVE:
8ffe46
+        g_value_set_boolean (value, ibus_property_get_sensitive (prop));
8ffe46
+        break;
8ffe46
+    case PROP_VISIBLE:
8ffe46
+        g_value_set_boolean (value, ibus_property_get_visible (prop));
8ffe46
+        break;
8ffe46
+    case PROP_PROP_TYPE:
8ffe46
+        g_value_set_enum (value, ibus_property_get_prop_type (prop));
8ffe46
+        break;
8ffe46
+    case PROP_STATE:
8ffe46
+        g_value_set_enum (value, ibus_property_get_state (prop));
8ffe46
+        break;
8ffe46
+    case PROP_SUB_PROPS:
8ffe46
+        g_value_set_object (value, ibus_property_get_sub_props (prop));
8ffe46
+        break;
8ffe46
+    default:
8ffe46
+        G_OBJECT_WARN_INVALID_PROPERTY_ID (prop, prop_id, pspec);
8ffe46
+    }
8ffe46
 }
8ffe46
 
8ffe46
 static void
8ffe46
 ibus_property_destroy (IBusProperty *prop)
8ffe46
 {
8ffe46
-    g_free (prop->key);
8ffe46
-    prop->key = NULL;
8ffe46
+    g_free (prop->priv->key);
8ffe46
+    prop->priv->key = NULL;
8ffe46
 
8ffe46
-    g_free (prop->icon);
8ffe46
-    prop->icon = NULL;
8ffe46
+    g_free (prop->priv->icon);
8ffe46
+    prop->priv->icon = NULL;
8ffe46
 
8ffe46
-    if (prop->label) {
8ffe46
-        g_object_unref (prop->label);
8ffe46
-        prop->label = NULL;
8ffe46
+    if (prop->priv->label) {
8ffe46
+        g_object_unref (prop->priv->label);
8ffe46
+        prop->priv->label = NULL;
8ffe46
     }
8ffe46
 
8ffe46
-    if (prop->tooltip) {
8ffe46
-        g_object_unref (prop->tooltip);
8ffe46
-        prop->tooltip = NULL;
8ffe46
+    if (prop->priv->tooltip) {
8ffe46
+        g_object_unref (prop->priv->tooltip);
8ffe46
+        prop->priv->tooltip = NULL;
8ffe46
     }
8ffe46
 
8ffe46
-    if (prop->sub_props) {
8ffe46
-        g_object_unref (prop->sub_props);
8ffe46
-        prop->sub_props = NULL;
8ffe46
+    if (prop->priv->sub_props) {
8ffe46
+        g_object_unref (prop->priv->sub_props);
8ffe46
+        prop->priv->sub_props = NULL;
8ffe46
     }
8ffe46
 
8ffe46
     IBUS_OBJECT_CLASS (ibus_property_parent_class)->destroy ((IBusObject *)prop);
8ffe46
@@ -99,15 +343,18 @@ ibus_property_serialize (IBusProperty    *prop,
8ffe46
 
8ffe46
     g_return_val_if_fail (IBUS_IS_PROPERTY (prop), FALSE);
8ffe46
 
8ffe46
-    g_variant_builder_add (builder, "s", prop->key);
8ffe46
-    g_variant_builder_add (builder, "u", prop->type);
8ffe46
-    g_variant_builder_add (builder, "v", ibus_serializable_serialize ((IBusSerializable *)prop->label));
8ffe46
-    g_variant_builder_add (builder, "s", prop->icon);
8ffe46
-    g_variant_builder_add (builder, "v", ibus_serializable_serialize ((IBusSerializable *)prop->tooltip));
8ffe46
-    g_variant_builder_add (builder, "b", prop->sensitive);
8ffe46
-    g_variant_builder_add (builder, "b", prop->visible);
8ffe46
-    g_variant_builder_add (builder, "u", prop->state);
8ffe46
-    g_variant_builder_add (builder, "v", ibus_serializable_serialize ((IBusSerializable *)prop->sub_props));
8ffe46
+    g_variant_builder_add (builder, "s", prop->priv->key);
8ffe46
+    g_variant_builder_add (builder, "u", prop->priv->type);
8ffe46
+    g_variant_builder_add (builder, "v",
8ffe46
+            ibus_serializable_serialize ((IBusSerializable *)prop->priv->label));
8ffe46
+    g_variant_builder_add (builder, "s", prop->priv->icon);
8ffe46
+    g_variant_builder_add (builder, "v",
8ffe46
+            ibus_serializable_serialize ((IBusSerializable *)prop->priv->tooltip));
8ffe46
+    g_variant_builder_add (builder, "b", prop->priv->sensitive);
8ffe46
+    g_variant_builder_add (builder, "b", prop->priv->visible);
8ffe46
+    g_variant_builder_add (builder, "u", prop->priv->state);
8ffe46
+    g_variant_builder_add (builder, "v",
8ffe46
+            ibus_serializable_serialize ((IBusSerializable *)prop->priv->sub_props));
8ffe46
 
8ffe46
     return TRUE;
8ffe46
 }
8ffe46
@@ -121,28 +368,28 @@ ibus_property_deserialize (IBusProperty *prop,
8ffe46
     retval = IBUS_SERIALIZABLE_CLASS (ibus_property_parent_class)->deserialize ((IBusSerializable *) prop, variant);
8ffe46
     g_return_val_if_fail (retval, 0);
8ffe46
 
8ffe46
-    g_variant_get_child (variant, retval++, "s", &prop->key);
8ffe46
-    g_variant_get_child (variant, retval++, "u", &prop->type);
8ffe46
+    g_variant_get_child (variant, retval++, "s", &prop->priv->key);
8ffe46
+    g_variant_get_child (variant, retval++, "u", &prop->priv->type);
8ffe46
 
8ffe46
     GVariant *subvar = g_variant_get_child_value (variant, retval++);
8ffe46
-    prop->label = IBUS_TEXT (ibus_serializable_deserialize (subvar));
8ffe46
-    g_object_ref_sink (prop->label);
8ffe46
+    prop->priv->label = IBUS_TEXT (ibus_serializable_deserialize (subvar));
8ffe46
+    g_object_ref_sink (prop->priv->label);
8ffe46
     g_variant_unref (subvar);
8ffe46
 
8ffe46
-    g_variant_get_child (variant, retval++, "s", &prop->icon);
8ffe46
+    g_variant_get_child (variant, retval++, "s", &prop->priv->icon);
8ffe46
 
8ffe46
     subvar = g_variant_get_child_value (variant, retval++);
8ffe46
-    prop->tooltip = IBUS_TEXT (ibus_serializable_deserialize (subvar));
8ffe46
-    g_object_ref_sink (prop->tooltip);
8ffe46
+    prop->priv->tooltip = IBUS_TEXT (ibus_serializable_deserialize (subvar));
8ffe46
+    g_object_ref_sink (prop->priv->tooltip);
8ffe46
     g_variant_unref (subvar);
8ffe46
 
8ffe46
-    g_variant_get_child (variant, retval++, "b", &prop->sensitive);
8ffe46
-    g_variant_get_child (variant, retval++, "b", &prop->visible);
8ffe46
-    g_variant_get_child (variant, retval++, "u", &prop->state);
8ffe46
+    g_variant_get_child (variant, retval++, "b", &prop->priv->sensitive);
8ffe46
+    g_variant_get_child (variant, retval++, "b", &prop->priv->visible);
8ffe46
+    g_variant_get_child (variant, retval++, "u", &prop->priv->state);
8ffe46
 
8ffe46
     subvar = g_variant_get_child_value (variant, retval++);
8ffe46
-    prop->sub_props = IBUS_PROP_LIST (ibus_serializable_deserialize (subvar));
8ffe46
-    g_object_ref_sink (prop->sub_props);
8ffe46
+    prop->priv->sub_props = IBUS_PROP_LIST (ibus_serializable_deserialize (subvar));
8ffe46
+    g_object_ref_sink (prop->priv->sub_props);
8ffe46
     g_variant_unref (subvar);
8ffe46
 
8ffe46
     return retval;
8ffe46
@@ -160,25 +407,25 @@ ibus_property_copy (IBusProperty       *dest,
8ffe46
     g_return_val_if_fail (IBUS_IS_PROPERTY (dest), FALSE);
8ffe46
     g_return_val_if_fail (IBUS_IS_PROPERTY (src), FALSE);
8ffe46
 
8ffe46
-    dest->key = g_strdup (src->key);
8ffe46
-    dest->icon = g_strdup (src->icon);
8ffe46
-    if (src->label) {
8ffe46
-        dest->label = (IBusText *) ibus_serializable_copy ((IBusSerializable *) src->label);
8ffe46
+    dest->priv->key = g_strdup (src->priv->key);
8ffe46
+    dest->priv->icon = g_strdup (src->priv->icon);
8ffe46
+    if (src->priv->label) {
8ffe46
+        dest->priv->label = (IBusText *) ibus_serializable_copy ((IBusSerializable *) src->priv->label);
8ffe46
     }
8ffe46
     else
8ffe46
-        dest->label = ibus_text_new_from_static_string ("");
8ffe46
-    if (src->tooltip) {
8ffe46
-        dest->tooltip = (IBusText *) ibus_serializable_copy ((IBusSerializable *) src->tooltip);
8ffe46
+        dest->priv->label = ibus_text_new_from_static_string ("");
8ffe46
+    if (src->priv->tooltip) {
8ffe46
+        dest->priv->tooltip = (IBusText *) ibus_serializable_copy ((IBusSerializable *) src->priv->tooltip);
8ffe46
     }
8ffe46
     else
8ffe46
-        dest->tooltip = ibus_text_new_from_static_string ("");
8ffe46
+        dest->priv->tooltip = ibus_text_new_from_static_string ("");
8ffe46
 
8ffe46
-    dest->sensitive = src->sensitive;
8ffe46
-    dest->visible = src->visible;
8ffe46
-    dest->type = src->type;
8ffe46
-    dest->state = src->state;
8ffe46
+    dest->priv->sensitive = src->priv->sensitive;
8ffe46
+    dest->priv->visible = src->priv->visible;
8ffe46
+    dest->priv->type = src->priv->type;
8ffe46
+    dest->priv->state = src->priv->state;
8ffe46
 
8ffe46
-    dest->sub_props = (IBusPropList *) ibus_serializable_copy ((IBusSerializable *) src->sub_props);
8ffe46
+    dest->priv->sub_props = (IBusPropList *) ibus_serializable_copy ((IBusSerializable *) src->priv->sub_props);
8ffe46
 
8ffe46
     return TRUE;
8ffe46
 }
8ffe46
@@ -192,7 +439,7 @@ ibus_property_new (const gchar   *key,
8ffe46
                    gboolean       sensitive,
8ffe46
                    gboolean       visible,
8ffe46
                    IBusPropState  state,
8ffe46
-                   IBusPropList  *prop_list)
8ffe46
+                   IBusPropList  *props)
8ffe46
 {
8ffe46
     g_return_val_if_fail (key != NULL, NULL);
8ffe46
     g_return_val_if_fail (type >= PROP_TYPE_NORMAL &&
8ffe46
@@ -201,19 +448,17 @@ ibus_property_new (const gchar   *key,
8ffe46
 
8ffe46
     IBusProperty *prop;
8ffe46
 
8ffe46
-    prop = (IBusProperty *)g_object_new (IBUS_TYPE_PROPERTY, NULL);
8ffe46
-
8ffe46
-    prop->key = g_strdup (key);
8ffe46
-    prop->type = type;
8ffe46
-
8ffe46
-    ibus_property_set_label (prop, label);
8ffe46
-    ibus_property_set_icon (prop, icon);
8ffe46
-    ibus_property_set_tooltip (prop, tooltip);
8ffe46
-    ibus_property_set_sensitive (prop, sensitive);
8ffe46
-    ibus_property_set_visible (prop, visible);
8ffe46
-    ibus_property_set_state (prop, state);
8ffe46
-    ibus_property_set_sub_props (prop, prop_list);
8ffe46
-
8ffe46
+    prop = (IBusProperty *)g_object_new (IBUS_TYPE_PROPERTY,
8ffe46
+                                         "key", key,
8ffe46
+                                         "prop-type", type,
8ffe46
+                                         "label", label,
8ffe46
+                                         "icon", icon,
8ffe46
+                                         "tooltip", tooltip,
8ffe46
+                                         "sensitive", sensitive,
8ffe46
+                                         "visible", visible,
8ffe46
+                                         "state", state,
8ffe46
+                                         "sub-props", props,
8ffe46
+                                         NULL);
8ffe46
     return prop;
8ffe46
 }
8ffe46
 
8ffe46
@@ -221,24 +466,25 @@ ibus_property_new (const gchar   *key,
8ffe46
 return_type                                                             \
8ffe46
 ibus_property_get_ ## field (IBusProperty *prop)                        \
8ffe46
 {                                                                       \
8ffe46
-    return prop->field;                                                 \
8ffe46
+    return prop->priv->field;                                           \
8ffe46
 }
8ffe46
 
8ffe46
 IBUS_PROPERTY_GET_FIELD (key, const gchar *)
8ffe46
 IBUS_PROPERTY_GET_FIELD (icon, const gchar *)
8ffe46
-IBUS_PROPERTY_GET_FIELD (label, const IBusText *)
8ffe46
-IBUS_PROPERTY_GET_FIELD (tooltip, const IBusText *)
8ffe46
+IBUS_PROPERTY_GET_FIELD (label, IBusText *)
8ffe46
+IBUS_PROPERTY_GET_FIELD (tooltip, IBusText *)
8ffe46
 IBUS_PROPERTY_GET_FIELD (sensitive, gboolean)
8ffe46
 IBUS_PROPERTY_GET_FIELD (visible, gboolean)
8ffe46
 IBUS_PROPERTY_GET_FIELD (state, IBusPropState)
8ffe46
-IBUS_PROPERTY_GET_FIELD (sub_props, const IBusPropList *)
8ffe46
+IBUS_PROPERTY_GET_FIELD (sub_props, IBusPropList *)
8ffe46
 #undef IBUS_PROPERTY_GET_FIELD
8ffe46
 
8ffe46
 /* ibus_property_get_type() exists */
8ffe46
 IBusPropType
8ffe46
 ibus_property_get_prop_type (IBusProperty *prop)
8ffe46
 {
8ffe46
-    return prop->type;
8ffe46
+    g_assert (IBUS_IS_PROPERTY (prop));
8ffe46
+    return prop->priv->type;
8ffe46
 }
8ffe46
 
8ffe46
 void
8ffe46
@@ -248,15 +494,15 @@ ibus_property_set_label (IBusProperty *prop,
8ffe46
     g_assert (IBUS_IS_PROPERTY (prop));
8ffe46
     g_return_if_fail (label == NULL || IBUS_IS_TEXT (label));
8ffe46
 
8ffe46
-    if (prop->label) {
8ffe46
-        g_object_unref (prop->label);
8ffe46
+    if (prop->priv->label) {
8ffe46
+        g_object_unref (prop->priv->label);
8ffe46
     }
8ffe46
 
8ffe46
     if (label == NULL) {
8ffe46
-        prop->label = ibus_text_new_from_static_string ("");
8ffe46
+        prop->priv->label = ibus_text_new_from_static_string ("");
8ffe46
     }
8ffe46
     else {
8ffe46
-        prop->label = g_object_ref_sink (label);
8ffe46
+        prop->priv->label = g_object_ref_sink (label);
8ffe46
     }
8ffe46
 }
8ffe46
 
8ffe46
@@ -266,8 +512,8 @@ ibus_property_set_icon (IBusProperty *prop,
8ffe46
 {
8ffe46
     g_assert (IBUS_IS_PROPERTY (prop));
8ffe46
 
8ffe46
-    g_free (prop->icon);
8ffe46
-    prop->icon = g_strdup (icon != NULL ? icon : "");
8ffe46
+    g_free (prop->priv->icon);
8ffe46
+    prop->priv->icon = g_strdup (icon != NULL ? icon : "");
8ffe46
 }
8ffe46
 
8ffe46
 void
8ffe46
@@ -277,17 +523,19 @@ ibus_property_set_tooltip (IBusProperty *prop,
8ffe46
     g_assert (IBUS_IS_PROPERTY (prop));
8ffe46
     g_assert (tooltip == NULL || IBUS_IS_TEXT (tooltip));
8ffe46
 
8ffe46
-    if (prop->tooltip) {
8ffe46
-        g_object_unref (prop->tooltip);
8ffe46
+    IBusPropertyPrivate *priv = prop->priv;
8ffe46
+
8ffe46
+    if (priv->tooltip) {
8ffe46
+        g_object_unref (priv->tooltip);
8ffe46
     }
8ffe46
 
8ffe46
     if (tooltip == NULL) {
8ffe46
-        prop->tooltip = ibus_text_new_from_static_string ("");
8ffe46
-        g_object_ref_sink (prop->tooltip);
8ffe46
+        priv->tooltip = ibus_text_new_from_static_string ("");
8ffe46
+        g_object_ref_sink (priv->tooltip);
8ffe46
     }
8ffe46
     else {
8ffe46
-        prop->tooltip = tooltip;
8ffe46
-        g_object_ref_sink (prop->tooltip);
8ffe46
+        priv->tooltip = tooltip;
8ffe46
+        g_object_ref_sink (priv->tooltip);
8ffe46
     }
8ffe46
 }
8ffe46
 
8ffe46
@@ -296,7 +544,7 @@ ibus_property_set_sensitive (IBusProperty *prop,
8ffe46
                              gboolean      sensitive)
8ffe46
 {
8ffe46
     g_assert (IBUS_IS_PROPERTY (prop));
8ffe46
-    prop->sensitive = sensitive;
8ffe46
+    prop->priv->sensitive = sensitive;
8ffe46
 }
8ffe46
 
8ffe46
 void
8ffe46
@@ -304,7 +552,7 @@ ibus_property_set_visible (IBusProperty *prop,
8ffe46
                            gboolean      visible)
8ffe46
 {
8ffe46
     g_assert (IBUS_IS_PROPERTY (prop));
8ffe46
-    prop->visible = visible;
8ffe46
+    prop->priv->visible = visible;
8ffe46
 }
8ffe46
 
8ffe46
 void
8ffe46
@@ -316,7 +564,7 @@ ibus_property_set_state (IBusProperty  *prop,
8ffe46
               state == PROP_STATE_CHECKED ||
8ffe46
               state == PROP_STATE_INCONSISTENT);
8ffe46
 
8ffe46
-    prop->state = state;
8ffe46
+    prop->priv->state = state;
8ffe46
 }
8ffe46
 
8ffe46
 void
8ffe46
@@ -326,17 +574,19 @@ ibus_property_set_sub_props (IBusProperty *prop,
8ffe46
     g_assert (IBUS_IS_PROPERTY (prop));
8ffe46
     g_assert (IBUS_IS_PROP_LIST (prop_list) || prop_list == NULL);
8ffe46
 
8ffe46
-    if (prop->sub_props) {
8ffe46
-        g_object_unref (prop->sub_props);
8ffe46
+    IBusPropertyPrivate *priv = prop->priv;
8ffe46
+
8ffe46
+    if (priv->sub_props) {
8ffe46
+        g_object_unref (priv->sub_props);
8ffe46
     }
8ffe46
 
8ffe46
     if (prop_list) {
8ffe46
-        prop->sub_props = prop_list;
8ffe46
+        priv->sub_props = prop_list;
8ffe46
         g_object_ref_sink (prop_list);
8ffe46
     }
8ffe46
     else {
8ffe46
-        prop->sub_props = ibus_prop_list_new ();
8ffe46
-        g_object_ref_sink (prop->sub_props);
8ffe46
+        priv->sub_props = ibus_prop_list_new ();
8ffe46
+        g_object_ref_sink (priv->sub_props);
8ffe46
     }
8ffe46
 }
8ffe46
 
8ffe46
@@ -347,25 +597,24 @@ ibus_property_update (IBusProperty *prop,
8ffe46
     g_assert (IBUS_IS_PROPERTY (prop));
8ffe46
     g_assert (IBUS_IS_PROPERTY (prop_update));
8ffe46
 
8ffe46
-    if (g_strcmp0 (prop->key, prop_update->key) != 0) {
8ffe46
-        return ibus_prop_list_update_property (prop->sub_props, prop_update);
8ffe46
+    IBusPropertyPrivate *priv = prop->priv;
8ffe46
+    IBusPropertyPrivate *priv_update = prop_update->priv;
8ffe46
+
8ffe46
+    if (g_strcmp0 (priv->key, priv_update->key) != 0) {
8ffe46
+        return ibus_prop_list_update_property (priv->sub_props, prop_update);
8ffe46
     }
8ffe46
 
8ffe46
-    g_free (prop->icon);
8ffe46
-    prop->icon = g_strdup (prop_update->icon);
8ffe46
+    /* Do not support update prop type */
8ffe46
+    g_assert (priv->type == priv_update->type);
8ffe46
 
8ffe46
-    if (prop->label) {
8ffe46
-        g_object_unref (prop->label);
8ffe46
-    }
8ffe46
-    prop->label = (IBusText *) g_object_ref_sink (prop_update->label);
8ffe46
+    ibus_property_set_icon (prop, ibus_property_get_icon (prop_update));
8ffe46
+    ibus_property_set_label (prop, ibus_property_get_label (prop_update));
8ffe46
+    ibus_property_set_tooltip (prop, ibus_property_get_tooltip (prop_update));
8ffe46
+    ibus_property_set_visible (prop, ibus_property_get_visible (prop_update));
8ffe46
+    ibus_property_set_state (prop, ibus_property_get_state (prop_update));
8ffe46
+    ibus_property_set_sensitive (prop, ibus_property_get_sensitive (prop_update));
8ffe46
 
8ffe46
-    if (prop->tooltip) {
8ffe46
-        g_object_unref (prop->tooltip);
8ffe46
-    }
8ffe46
-    prop->tooltip = (IBusText *) g_object_ref_sink (prop_update->tooltip);
8ffe46
-    prop->visible = prop_update->visible;
8ffe46
-    prop->state = prop_update->state;
8ffe46
-    prop->sensitive = prop_update->sensitive;
8ffe46
+    /* Do not support update sub props */
8ffe46
 
8ffe46
     return TRUE;
8ffe46
 }
8ffe46
diff --git a/src/ibusproperty.h b/src/ibusproperty.h
8ffe46
index 5e76c8f..ddbadc8 100644
8ffe46
--- a/src/ibusproperty.h
8ffe46
+++ b/src/ibusproperty.h
8ffe46
@@ -114,6 +114,7 @@ typedef enum {
8ffe46
 
8ffe46
 typedef struct _IBusProperty IBusProperty;
8ffe46
 typedef struct _IBusPropertyClass IBusPropertyClass;
8ffe46
+typedef struct _IBusPropertyPrivate IBusPropertyPrivate;
8ffe46
 
8ffe46
 #ifndef __PROPLIST_DEFINED
8ffe46
 #define __PROPLIST_DEFINED
8ffe46
@@ -137,20 +138,11 @@ typedef struct _IBusPropListClass IBusPropListClass;
8ffe46
  * UI component for input method engine property.
8ffe46
  */
8ffe46
 struct _IBusProperty {
8ffe46
+    /*< private >*/
8ffe46
     IBusSerializable parent;
8ffe46
+    IBusPropertyPrivate *priv;
8ffe46
 
8ffe46
-    /*< public >*/
8ffe46
-    gchar    *key;
8ffe46
-    gchar    *icon;
8ffe46
-    IBusText *label;
8ffe46
-    IBusText *tooltip;
8ffe46
-
8ffe46
-    gboolean sensitive;
8ffe46
-    gboolean visible;
8ffe46
-    guint type;
8ffe46
-    guint state;
8ffe46
-
8ffe46
-    IBusPropList *sub_props;
8ffe46
+    gpointer pdummy[7];
8ffe46
 };
8ffe46
 
8ffe46
 struct _IBusPropertyClass {
8ffe46
@@ -194,22 +186,13 @@ IBusProperty    *ibus_property_new          (const gchar    *key,
8ffe46
 const gchar *    ibus_property_get_key      (IBusProperty   *prop);
8ffe46
 
8ffe46
 /**
8ffe46
- * ibus_property_get_prop_type:
8ffe46
- * @prop: An IBusProperty.
8ffe46
- * @returns: the type of IBusProperty.
8ffe46
- *
8ffe46
- * Get the type of IBusProperty.
8ffe46
- */
8ffe46
-IBusPropType     ibus_property_get_prop_type(IBusProperty   *prop);
8ffe46
-
8ffe46
-/**
8ffe46
  * ibus_property_get_label:
8ffe46
  * @prop: An IBusProperty.
8ffe46
  * @returns: the label of IBusProperty. Should not be freed.
8ffe46
  *
8ffe46
  * Get the label of IBusProperty.
8ffe46
  */
8ffe46
-const IBusText * ibus_property_get_label    (IBusProperty   *prop);
8ffe46
+IBusText *      ibus_property_get_label    (IBusProperty   *prop);
8ffe46
 
8ffe46
 /**
8ffe46
  * ibus_property_set_label:
8ffe46
@@ -247,7 +230,7 @@ void             ibus_property_set_icon     (IBusProperty   *prop,
8ffe46
  *
8ffe46
  * Get the tooltip of IBusProperty.
8ffe46
  */
8ffe46
-const IBusText * ibus_property_get_tooltip  (IBusProperty   *prop);
8ffe46
+IBusText *      ibus_property_get_tooltip  (IBusProperty   *prop);
8ffe46
 
8ffe46
 /**
8ffe46
  * ibus_property_set_tooltip:
8ffe46
@@ -298,6 +281,15 @@ void             ibus_property_set_visible  (IBusProperty   *prop,
8ffe46
                                              gboolean        visible);
8ffe46
 
8ffe46
 /**
8ffe46
+ * ibus_property_get_property_type:
8ffe46
+ * @prop: An IBusProperty.
8ffe46
+ * @returns: the type of IBusProperty.
8ffe46
+ *
8ffe46
+ * Get the type of IBusProperty.
8ffe46
+ */
8ffe46
+IBusPropType     ibus_property_get_prop_type(IBusProperty   *prop);
8ffe46
+
8ffe46
+/**
8ffe46
  * ibus_property_get_state:
8ffe46
  * @prop: An IBusProperty.
8ffe46
  * @returns: the state of IBusProperty.
8ffe46
@@ -323,8 +315,7 @@ void             ibus_property_set_state    (IBusProperty   *prop,
8ffe46
  *
8ffe46
  * Get the IBusPropList of IBusProperty.
8ffe46
  */
8ffe46
-const IBusPropList *
8ffe46
-                 ibus_property_get_sub_props(IBusProperty   *prop);
8ffe46
+IBusPropList *   ibus_property_get_sub_props(IBusProperty   *prop);
8ffe46
 
8ffe46
 /**
8ffe46
  * ibus_property_set_sub_props:
8ffe46
-- 
8ffe46
1.7.7.4
8ffe46
8ffe46
From df10a24f905c8eea420a5fd33eff78417312410c Mon Sep 17 00:00:00 2001
8ffe46
From: Peng Huang <shawn.p.huang@gmail.com>
8ffe46
Date: Thu, 22 Dec 2011 09:57:23 -0500
8ffe46
Subject: [PATCH] Add ibus_text_set_attributes for scipt language
8ffe46
 bindings.
8ffe46
8ffe46
BUG=None
8ffe46
TEST=Linux desktop
8ffe46
8ffe46
Review URL: http://codereview.appspot.com/5500067
8ffe46
---
8ffe46
 src/ibustext.c |   12 +++++++++++-
8ffe46
 src/ibustext.h |   13 +++++++++++--
8ffe46
 2 files changed, 22 insertions(+), 3 deletions(-)
8ffe46
8ffe46
diff --git a/src/ibustext.c b/src/ibustext.c
8ffe46
index f4085e9..e5218d0 100644
8ffe46
--- a/src/ibustext.c
8ffe46
+++ b/src/ibustext.c
8ffe46
@@ -272,8 +272,18 @@ ibus_text_get_text (IBusText *text)
8ffe46
     return text->text;
8ffe46
 }
8ffe46
 
8ffe46
-const IBusAttrList *
8ffe46
+IBusAttrList *
8ffe46
 ibus_text_get_attributes (IBusText *text)
8ffe46
 {
8ffe46
     return text->attrs;
8ffe46
 }
8ffe46
+
8ffe46
+void
8ffe46
+ibus_text_set_attributes (IBusText     *text,
8ffe46
+                          IBusAttrList *attrs)
8ffe46
+{
8ffe46
+    if (text->attrs)
8ffe46
+        g_object_unref (text->attrs);
8ffe46
+    text->attrs = attrs;
8ffe46
+    g_object_ref_sink (text->attrs);
8ffe46
+}
8ffe46
diff --git a/src/ibustext.h b/src/ibustext.h
8ffe46
index 1dca466..f6e25a7 100644
8ffe46
--- a/src/ibustext.h
8ffe46
+++ b/src/ibustext.h
8ffe46
@@ -194,8 +194,17 @@ const gchar *    ibus_text_get_text                 (IBusText       *text);
8ffe46
  *
8ffe46
  * Return the attributes in an IBusText. Should not be freed.
8ffe46
  */
8ffe46
-const IBusAttrList *
8ffe46
-                 ibus_text_get_attributes           (IBusText       *text);
8ffe46
+IBusAttrList *   ibus_text_get_attributes           (IBusText       *text);
8ffe46
+
8ffe46
+/**
8ffe46
+ * ibus_text_set_attributes:
8ffe46
+ * @text: An IBusText.
8ffe46
+ * @attrs: An IBusAttrList
8ffe46
+ */
8ffe46
+void             ibus_text_set_attributes           (IBusText       *text,
8ffe46
+                                                     IBusAttrList   *attrs);
8ffe46
+
8ffe46
+
8ffe46
 G_END_DECLS
8ffe46
 #endif
8ffe46
 
8ffe46
-- 
8ffe46
1.7.7.4
8ffe46
8ffe46
From 4d1f38314b3a9c3dc1683053cda10cfa36fd9019 Mon Sep 17 00:00:00 2001
8ffe46
From: Peng Huang <shawn.p.huang@gmail.com>
8ffe46
Date: Thu, 22 Dec 2011 09:59:05 -0500
8ffe46
Subject: [PATCH] Fix a typo in docs/references/ibus/Makefile
8ffe46
8ffe46
BUG=None
8ffe46
TEST=make
8ffe46
8ffe46
Review URL: http://codereview.appspot.com/5496079
8ffe46
---
8ffe46
 docs/reference/ibus/Makefile.am |    2 +-
8ffe46
 1 files changed, 1 insertions(+), 1 deletions(-)
8ffe46
8ffe46
diff --git a/docs/reference/ibus/Makefile.am b/docs/reference/ibus/Makefile.am
8ffe46
index 4fa77a1..75e3815 100644
8ffe46
--- a/docs/reference/ibus/Makefile.am
8ffe46
+++ b/docs/reference/ibus/Makefile.am
8ffe46
@@ -117,7 +117,7 @@ trim-build.stamp: scan-build.stamp
8ffe46
 	$(AM_V_GEN) \
8ffe46
 	    $(SED) -f $(srcdir)/trim.sed -i.bak \
8ffe46
 			$(builddir)/$(DOC_MODULE)-sections.txt && \
8ffe46
-	    $(RM) $(buildir)/$(DOC_MODULE)-sections.txt.bak && \
8ffe46
+	    $(RM) $(builddir)/$(DOC_MODULE)-sections.txt.bak && \
8ffe46
 	    touch trim-build.stamp
8ffe46
 
8ffe46
 tmpl-build.stamp: trim-build.stamp  $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-overrides.txt
8ffe46
-- 
8ffe46
1.7.7.4
8ffe46
8ffe46
From 377cf484ea64fc2f30706d298cf1f33debdd9c30 Mon Sep 17 00:00:00 2001
8ffe46
From: fujiwarat <takao.fujiwara1@gmail.com>
8ffe46
Date: Fri, 30 Dec 2011 13:53:50 +0900
8ffe46
Subject: [PATCH] Fix ibus-x11 SEGV in _process_key_event_done.
8ffe46
8ffe46
IMForwardEvent() calls _Xi18nFindClient() and it could return NULL.
8ffe46
Maybe the connect_id would be disconnected during the async
8ffe46
process_key_event.
8ffe46
This fix checks XIM_DISCONNECT in ims_protocol_handler() to cancel
8ffe46
IMForwardEvent() in _process_key_event_done().
8ffe46
---
8ffe46
 client/x11/main.c |   17 +++++++++++++++++
8ffe46
 1 files changed, 17 insertions(+), 0 deletions(-)
8ffe46
8ffe46
diff --git a/client/x11/main.c b/client/x11/main.c
8ffe46
index 58069fc..3cb03f0 100644
8ffe46
--- a/client/x11/main.c
8ffe46
+++ b/client/x11/main.c
8ffe46
@@ -77,6 +77,8 @@ struct _X11IC {
8ffe46
     gint             onspot_preedit_length;
8ffe46
 };
8ffe46
 
8ffe46
+static gint disconnected_id = 0;
8ffe46
+
8ffe46
 static void     _xim_set_cursor_location    (X11IC              *x11ic);
8ffe46
 static void     _context_commit_text_cb     (IBusInputContext   *context,
8ffe46
                                              IBusText           *text,
8ffe46
@@ -464,6 +466,12 @@ _process_key_event_done (GObject      *object,
8ffe46
         g_error_free (error);
8ffe46
     }
8ffe46
 
8ffe46
+    if (pfe->connect_id == disconnected_id) {
8ffe46
+        g_slice_free (IMForwardEventStruct, pfe);
8ffe46
+        disconnected_id = 0;
8ffe46
+        return;
8ffe46
+    }
8ffe46
+
8ffe46
     if (retval == FALSE) {
8ffe46
         IMForwardEvent (_xims, (XPointer) pfe);
8ffe46
     }
8ffe46
@@ -734,6 +742,13 @@ xim_reset_ic (XIMS xims, IMResetICStruct *call_data)
8ffe46
     return 1;
8ffe46
 }
8ffe46
 
8ffe46
+static int
8ffe46
+xim_disconnect_ic (XIMS xims, IMDisConnectStruct *call_data)
8ffe46
+{
8ffe46
+    disconnected_id = call_data->connect_id;
8ffe46
+    return 0;
8ffe46
+}
8ffe46
+
8ffe46
 int
8ffe46
 ims_protocol_handler (XIMS xims, IMProtocol *call_data)
8ffe46
 {
8ffe46
@@ -773,6 +788,8 @@ ims_protocol_handler (XIMS xims, IMProtocol *call_data)
8ffe46
     case XIM_SYNC_REPLY:
8ffe46
         LOG (1, "XIM_SYNC_REPLY");
8ffe46
         return 0;
8ffe46
+    case XIM_DISCONNECT:
8ffe46
+        return xim_disconnect_ic (xims, (IMDisConnectStruct *)call_data);
8ffe46
     default:
8ffe46
         LOG (1, "Unkown (%d)", call_data->major_code);
8ffe46
         return 0;
8ffe46
-- 
8ffe46
1.7.7.4
8ffe46