summaryrefslogtreecommitdiff
path: root/gtk/gtkimmodule.c
diff options
context:
space:
mode:
authorMatthias Clasen <matthiasc@src.gnome.org>2009-01-23 06:04:05 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2009-01-23 06:04:05 +0000
commit280eeb02e1a3c09737b1c370c7302efe65dd325b (patch)
tree20d5cb034fc6e7f6a12819a3544aa8b24933a394 /gtk/gtkimmodule.c
parenta220373a55bcd5ee15fa553770042e932dcaa382 (diff)
downloadgtk+-280eeb02e1a3c09737b1c370c7302efe65dd325b.tar.gz
Don't set up im stuff if the widget is not realized.
* gtk/gtktextview.c: Don't set up im stuff if the widget is not realized. * gtk/gtkimmodule.c: Assert that we have a window. svn path=/trunk/; revision=22193
Diffstat (limited to 'gtk/gtkimmodule.c')
-rw-r--r--gtk/gtkimmodule.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gtk/gtkimmodule.c b/gtk/gtkimmodule.c
index b347abd4f2..274166d362 100644
--- a/gtk/gtkimmodule.c
+++ b/gtk/gtkimmodule.c
@@ -671,6 +671,9 @@ _gtk_im_module_get_default_context_id (GdkWindow *client_window)
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 @@ _gtk_im_module_get_default_context_id (GdkWindow *client_window)
/* 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)