5fabd65
From 2238af14b654218696220f83b5ee39ae49c2ad98 Mon Sep 17 00:00:00 2001
5fabd65
From: fujiwarat <takao.fujiwara1@gmail.com>
5fabd65
Date: Wed, 7 Sep 2011 15:25:27 +0900
5fabd65
Subject: [PATCH] Added a workaround to disable preedit in gnome-shell
5fabd65
5fabd65
https://bugzilla.gnome.org/show_bug.cgi?id=658420
5fabd65
---
5fabd65
 client/gtk2/ibusimcontext.c |    8 ++++++++
5fabd65
 1 files changed, 8 insertions(+), 0 deletions(-)
5fabd65
5fabd65
diff --git a/client/gtk2/ibusimcontext.c b/client/gtk2/ibusimcontext.c
5fabd65
index 327a5d9..39d2d0c 100644
5fabd65
--- a/client/gtk2/ibusimcontext.c
5fabd65
+++ b/client/gtk2/ibusimcontext.c
5fabd65
@@ -583,6 +583,14 @@ ibus_im_context_init (GObject *obj)
5fabd65
 #else
5fabd65
     ibusimcontext->caps = IBUS_CAP_PREEDIT_TEXT | IBUS_CAP_FOCUS;
5fabd65
 #endif
5fabd65
+    if (!g_getenv ("IBUS_GNOME_SHELL_ENABLE_PREEDIT_TEXT")) {
5fabd65
+        const gchar * prgname = g_get_prgname ();
5fabd65
+        if (g_strcmp0 (prgname, "gnome-shell") == 0) {
5fabd65
+            if (ibusimcontext->caps | IBUS_CAP_PREEDIT_TEXT) {
5fabd65
+                ibusimcontext->caps ^= IBUS_CAP_PREEDIT_TEXT;
5fabd65
+            }
5fabd65
+        }
5fabd65
+    }
5fabd65
 
5fabd65
 
5fabd65
     // Create slave im context
5fabd65
-- 
5fabd65
1.7.5.4
5fabd65