]> Pileus Git - ~andy/gtk/commitdiff
Avoid infinite recursion in the ime input module
authorMatthias Clasen <mclasen@redhat.com>
Mon, 19 Nov 2012 14:29:51 +0000 (09:29 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 19 Nov 2012 14:30:44 +0000 (09:30 -0500)
modules/input/gtkimcontextime.c

index 009af3febe08f1b495deea2f908dffbf30fedfac..912415a5af6abf93424dba9309ff4601f7f865e7 100644 (file)
@@ -354,11 +354,14 @@ gtk_im_context_ime_reset (GtkIMContext *context)
   if (!himc)
     return;
 
-  if (context_ime->preediting && ImmGetOpenStatus (himc))
-    ImmNotifyIME (himc, NI_COMPOSITIONSTR, CPS_CANCEL, 0);
+  if (context_ime->preediting)
+    {
+      if (ImmGetOpenStatus (himc))
+        ImmNotifyIME (himc, NI_COMPOSITIONSTR, CPS_CANCEL, 0);
 
-  context_ime->preediting = FALSE;
-  g_signal_emit_by_name (context, "preedit-changed");
+      context_ime->preediting = FALSE;
+      g_signal_emit_by_name (context, "preedit-changed");
+    }
 
   ImmReleaseContext (hwnd, himc);
 }