[uim-commit] r3092 - trunk/gtk

ekato at freedesktop.org ekato at freedesktop.org
Thu Feb 2 23:21:58 PST 2006


Author: ekato
Date: 2006-02-02 23:21:52 -0800 (Thu, 02 Feb 2006)
New Revision: 3092

Modified:
   trunk/gtk/gtk-im-uim.c
Log:
* gtk/gtk-im-uim.c : Don't set candwin's text widget as
  a cur_toplevel.
(cwin_list) : New.
(update_cur_toplevel) : Check candwin's text_view.
(im_uim_init) : Update cwin_list.
(im_uim_finalize) : Ditto.


Modified: trunk/gtk/gtk-im-uim.c
===================================================================
--- trunk/gtk/gtk-im-uim.c	2006-02-03 04:49:27 UTC (rev 3091)
+++ trunk/gtk/gtk-im-uim.c	2006-02-03 07:21:52 UTC (rev 3092)
@@ -114,6 +114,7 @@
 static GtkWidget *grab_widget;
 static gulong cur_key_press_handler_id;
 static gulong cur_key_release_handler_id;
+static GList *cwin_list;
 #endif
 
 static IMUIMContext context_list;
@@ -345,7 +346,22 @@
 static void
 update_cur_toplevel(IMUIMContext *uic)
 {
+  /* Don't set our candwin's text widget as cur_toplevel */
   if (uic->widget) {
+    UIMCandWinGtk *cwin;
+    GList *tmp_list;
+  
+    tmp_list = cwin_list;
+    while (tmp_list) {
+      cwin = tmp_list->data;
+      if (cwin->sub_window.text_view &&
+		      cwin->sub_window.text_view == uic->widget)
+	  return;
+      tmp_list = tmp_list->next;
+    }
+  }
+
+  if (uic->widget) {
     GtkWidget *toplevel = gtk_widget_get_toplevel(uic->widget);
     if (toplevel && GTK_WIDGET_TOPLEVEL(toplevel)) {
       if (cur_toplevel != toplevel) {
@@ -1101,6 +1117,9 @@
   uic->prev_preedit_len = 0;
 
   uic->cwin = uim_cand_win_gtk_new();
+#if IM_UIM_USE_TOPLEVEL
+  cwin_list = g_list_append(cwin_list, uic->cwin);
+#endif
   uic->cwin_is_active = FALSE;
   uic->preedit_window = NULL;
   uic->preedit_handler_id = 0;
@@ -1120,6 +1139,9 @@
 
   if (uic->cwin) {
     gtk_widget_destroy(GTK_WIDGET(uic->cwin));
+#if IM_UIM_USE_TOPLEVEL
+    cwin_list = g_list_remove(cwin_list, uic->cwin);
+#endif
     uic->cwin = NULL;
   }
   if (uic->caret_state_indicator) {



More information about the uim-commit mailing list