97 lines
3.2 KiB
Diff
97 lines
3.2 KiB
Diff
From fbdd157b2ab1e6e873818132530dd9e55e4f94dd Mon Sep 17 00:00:00 2001
|
|
From: Peng Huang <shawn.p.huang@gmail.com>
|
|
Date: Mon, 7 Mar 2011 10:26:04 -0500
|
|
Subject: [PATCH] Move gtk_key_snooper_remove from function object_fini to class_fini.
|
|
|
|
BUG=http://crosbug.com/12803
|
|
TEST=Linux desktop
|
|
|
|
Review URL: http://codereview.appspot.com/4267044
|
|
---
|
|
client/gtk2/ibusimcontext.c | 24 +++++++++++++++---------
|
|
1 files changed, 15 insertions(+), 9 deletions(-)
|
|
|
|
diff --git a/client/gtk2/ibusimcontext.c b/client/gtk2/ibusimcontext.c
|
|
index a634d0e..31a415d 100644
|
|
--- a/client/gtk2/ibusimcontext.c
|
|
+++ b/client/gtk2/ibusimcontext.c
|
|
@@ -88,6 +88,7 @@ static GtkWidget *_input_widget = NULL;
|
|
|
|
/* functions prototype */
|
|
static void ibus_im_context_class_init (IBusIMContextClass *class);
|
|
+static void ibus_im_context_class_fini (IBusIMContextClass *class);
|
|
static void ibus_im_context_init (GObject *obj);
|
|
static void ibus_im_context_finalize (GObject *obj);
|
|
static void ibus_im_context_reset (GtkIMContext *context);
|
|
@@ -152,10 +153,10 @@ ibus_im_context_register_type (GTypeModule *type_module)
|
|
|
|
static const GTypeInfo ibus_im_context_info = {
|
|
sizeof (IBusIMContextClass),
|
|
- (GBaseInitFunc) NULL,
|
|
- (GBaseFinalizeFunc) NULL,
|
|
+ (GBaseInitFunc) NULL,
|
|
+ (GBaseFinalizeFunc) NULL,
|
|
(GClassInitFunc) ibus_im_context_class_init,
|
|
- NULL, /* class finialize */
|
|
+ (GClassFinalizeFunc) ibus_im_context_class_fini,
|
|
NULL, /* class data */
|
|
sizeof (IBusIMContext),
|
|
0,
|
|
@@ -477,6 +478,16 @@ ibus_im_context_class_init (IBusIMContextClass *class)
|
|
_key_snooper_id = gtk_key_snooper_install (_key_snooper_cb, NULL);
|
|
}
|
|
|
|
+static void
|
|
+ibus_im_context_class_fini (IBusIMContextClass *class)
|
|
+{
|
|
+ if (_key_snooper_id != 0) {
|
|
+ IDEBUG ("snooper is terminated.");
|
|
+ gtk_key_snooper_remove (_key_snooper_id);
|
|
+ _key_snooper_id = 0;
|
|
+ }
|
|
+}
|
|
+
|
|
/* Copied from gtk+2.0-2.20.1/modules/input/imcedilla.c to fix crosbug.com/11421.
|
|
* Overwrite the original Gtk+'s compose table in gtk+-2.x.y/gtk/gtkimcontextsimple.c. */
|
|
|
|
@@ -601,12 +612,6 @@ ibus_im_context_finalize (GObject *obj)
|
|
pango_attr_list_unref (ibusimcontext->preedit_attrs);
|
|
}
|
|
|
|
- if (_key_snooper_id != 0) {
|
|
- IDEBUG ("snooper is terminated.");
|
|
- gtk_key_snooper_remove (_key_snooper_id);
|
|
- _key_snooper_id = 0;
|
|
- }
|
|
-
|
|
G_OBJECT_CLASS(parent_class)->finalize (obj);
|
|
}
|
|
|
|
--
|
|
1.7.4.1
|
|
|
|
From c0489ba017f298e51efe86bc7f5def1928389197 Mon Sep 17 00:00:00 2001
|
|
From: fujiwarat <takao.fujiwara1@gmail.com>
|
|
Date: Fri, 11 Mar 2011 15:53:53 +0900
|
|
Subject: [PATCH] Fix preedit_string = NULL in ibus-x11 _free_ic()
|
|
|
|
---
|
|
client/x11/main.c | 1 +
|
|
1 files changed, 1 insertions(+), 0 deletions(-)
|
|
|
|
diff --git a/client/x11/main.c b/client/x11/main.c
|
|
index a2967cc..16104de 100644
|
|
--- a/client/x11/main.c
|
|
+++ b/client/x11/main.c
|
|
@@ -526,6 +526,7 @@ _free_ic (gpointer data, gpointer user_data)
|
|
g_return_if_fail (x11ic != NULL);
|
|
|
|
g_free (x11ic->preedit_string);
|
|
+ x11ic->preedit_string = NULL;
|
|
|
|
if (x11ic->preedit_attrs) {
|
|
g_object_unref (x11ic->preedit_attrs);
|
|
--
|
|
1.7.4.1
|
|
|