gtk+ r22193 - in trunk: . gtk



Author: matthiasc
Date: Fri Jan 23 06:04:05 2009
New Revision: 22193
URL: http://svn.gnome.org/viewvc/gtk+?rev=22193&view=rev

Log:
        * gtk/gtktextview.c: Don't set up im stuff if the widget
        is not realized.

        * gtk/gtkimmodule.c: Assert that we have a window.



Modified:
   trunk/ChangeLog
   trunk/gtk/gtkimmodule.c
   trunk/gtk/gtktextview.c

Modified: trunk/gtk/gtkimmodule.c
==============================================================================
--- trunk/gtk/gtkimmodule.c	(original)
+++ trunk/gtk/gtkimmodule.c	Fri Jan 23 06:04:05 2009
@@ -671,6 +671,9 @@
   GdkScreen *screen;
   GtkSettings *settings;
       
+  /* assertion to make sure all of the unexpected invocation is really gone. */
+  g_return_val_if_fail (client_window != NULL, SIMPLE_ID);
+
   if (!contexts_hash)
     gtk_im_module_initialize ();
 
@@ -682,7 +685,7 @@
 
   /* Check if the certain immodule is set in XSETTINGS.
    */
-  if (client_window != NULL && GDK_IS_DRAWABLE (client_window))
+  if (GDK_IS_DRAWABLE (client_window))
     {
       screen = gdk_drawable_get_screen (GDK_DRAWABLE (client_window));
       if (screen)

Modified: trunk/gtk/gtktextview.c
==============================================================================
--- trunk/gtk/gtktextview.c	(original)
+++ trunk/gtk/gtktextview.c	Fri Jan 23 06:04:05 2009
@@ -2076,7 +2076,8 @@
    */
   area.width = 0;
 
-  gtk_im_context_set_cursor_location (text_view->im_context, &area);
+  if (GTK_WIDGET_REALIZED (text_view))
+    gtk_im_context_set_cursor_location (text_view->im_context, &area);
 }
 
 static gboolean
@@ -3837,6 +3838,9 @@
       
       tmp_list = tmp_list->next;
     }
+
+  /* Ensure updating the spot location. */
+  gtk_text_view_update_im_spot_location(text_view);
 }
 
 static void



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