gtk+ r19878 - in trunk: . gtk



Author: matthiasc
Date: Sat Mar 15 04:24:50 2008
New Revision: 19878
URL: http://svn.gnome.org/viewvc/gtk+?rev=19878&view=rev

Log:
2008-03-15  Matthias Clasen  <mclasen redhat com>

        * gtk/gtkimcontextsimple.c: Emit preedit_start/_end as
        appropriate.  (#521934, Huang Peng)




Modified:
   trunk/ChangeLog
   trunk/gtk/gtkimcontextsimple.c

Modified: trunk/gtk/gtkimcontextsimple.c
==============================================================================
--- trunk/gtk/gtkimcontextsimple.c	(original)
+++ trunk/gtk/gtkimcontextsimple.c	Sat Mar 15 04:24:50 2008
@@ -161,6 +161,7 @@
       context_simple->tentative_match = 0;
       context_simple->tentative_match_len = 0;
       g_signal_emit_by_name (context_simple, "preedit_changed");
+      g_signal_emit_by_name (context_simple, "preedit_end");
     }
 
   g_signal_emit_by_name (context, "commit", &buf);
@@ -724,6 +725,7 @@
 	      context_simple->compose_buffer[0] = 0;
 	      
 	      g_signal_emit_by_name (context_simple, "preedit_changed");
+	      g_signal_emit_by_name (context_simple, "preedit_end");
 	    }
 
 	  return TRUE;
@@ -733,7 +735,7 @@
     }
 
   /* Ignore modifier key presses */
-  for (i=0; i < G_N_ELEMENTS (gtk_compose_ignore); i++)
+  for (i = 0; i < G_N_ELEMENTS (gtk_compose_ignore); i++)
     if (event->keyval == gtk_compose_ignore[i])
       return FALSE;
 
@@ -786,6 +788,9 @@
 	}
 
       g_signal_emit_by_name (context_simple, "preedit_changed");
+
+      if (!context_simple->in_hex_sequence)
+        g_signal_emit_by_name (context_simple, "preedit_end");
       
       return TRUE;
     }
@@ -819,6 +824,7 @@
       context_simple->modifiers_dropped = FALSE;
       context_simple->tentative_match = 0;
 
+      g_signal_emit_by_name (context_simple, "preedit_start");
       g_signal_emit_by_name (context_simple, "preedit_changed");
   
       return TRUE;
@@ -877,6 +883,9 @@
 	  
 	  g_signal_emit_by_name (context_simple, "preedit_changed");
 
+	  if (!context_simple->in_hex_sequence)
+	    g_signal_emit_by_name (context_simple, "preedit_end");
+
 	  return TRUE;
         }
     }
@@ -914,6 +923,7 @@
       context_simple->tentative_match = 0;
       context_simple->tentative_match_len = 0;
       g_signal_emit_by_name (context_simple, "preedit_changed");
+      g_signal_emit_by_name (context_simple, "preedit_end");
     }
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]