[uim-commit] r3096 - trunk/gtk

ekato at freedesktop.org ekato at freedesktop.org
Sat Feb 4 19:24:37 PST 2006


Author: ekato
Date: 2006-02-04 19:24:33 -0800 (Sat, 04 Feb 2006)
New Revision: 3096

Modified:
   trunk/gtk/gtk-im-uim.c
Log:
* gtk/gtk-im-uim.c : Add toplevel event hack removed in r3014
  again for OOo 2.0 gtk plugin.


Modified: trunk/gtk/gtk-im-uim.c
===================================================================
--- trunk/gtk/gtk-im-uim.c	2006-02-04 05:37:33 UTC (rev 3095)
+++ trunk/gtk/gtk-im-uim.c	2006-02-05 03:24:33 UTC (rev 3096)
@@ -64,6 +64,9 @@
 #define IM_UIM_USE_SNOOPER	0
 #define IM_UIM_USE_TOPLEVEL	1
 
+/* still need investigating... */
+#define IM_UIM_USE_TOPLEVEL_EVENT_HACK	1
+
 /* exported symbols */
 GtkIMContext *im_module_create(const gchar *context_id);
 void im_module_list(const GtkIMContextInfo ***contexts, int *n_contexts);
@@ -99,7 +102,10 @@
 
 #if IM_UIM_USE_TOPLEVEL
   GtkWidget *widget;
+#if IM_UIM_USE_TOPLEVEL_EVENT_HACK
+  GdkEventKey event_rec;
 #endif
+#endif
 
   struct _IMUIMContext *prev, *next;
 } IMUIMContext;
@@ -350,7 +356,7 @@
   if (uic->widget) {
     UIMCandWinGtk *cwin;
     GList *tmp_list;
-  
+
     tmp_list = cwin_list;
     while (tmp_list) {
       cwin = tmp_list->data;
@@ -930,7 +936,12 @@
 #if IM_UIM_USE_SNOOPER
   if (!snooper_installed) {
 #elif IM_UIM_USE_TOPLEVEL
+#if IM_UIM_USE_TOPLEVEL_EVENT_HACK
+  if (!cur_toplevel || (cur_toplevel && grab_widget) ||
+		  key->time != uic->event_rec.time) {
+#else
   if (!cur_toplevel || (cur_toplevel && grab_widget)) {
+#endif
 #else
   if (TRUE) {
 #endif
@@ -1110,7 +1121,10 @@
   uic->win = NULL;
 #if IM_UIM_USE_TOPLEVEL
   uic->widget = NULL;
+#if IM_UIM_USE_TOPLEVEL_EVENT_HACK
+  uic->event_rec.time = 0;
 #endif
+#endif
   uic->caret_state_indicator = NULL;
   uic->pseg = NULL;
   uic->nr_psegs = 0;
@@ -1294,6 +1308,9 @@
   if (focused_context == uic) {
     int rv, kv, mod;
 
+#if IM_UIM_USE_TOPLEVEL_EVENT_HACK
+    uic->event_rec.time = event->time;
+#endif
     im_uim_convert_keyevent(event, &kv, &mod);
 
     if (event->type == GDK_KEY_RELEASE)



More information about the uim-commit mailing list