Index: gtkimcontextxim.c
===================================================================
RCS file: /cvs/gnome/gtk+/modules/input/gtkimcontextxim.c,v
retrieving revision 1.32.2.5
diff -u -p -r1.32.2.5 gtkimcontextxim.c
--- gtkimcontextxim.c	10 Jun 2003 18:25:25 -0000	1.32.2.5
+++ gtkimcontextxim.c	18 Jun 2003 23:23:28 -0000
@@ -419,17 +419,18 @@ get_im (GdkWindow *client_window,
 	const char *locale)
 {
   GSList *tmp_list;
-  GtkXIMInfo *info;
+  GtkXIMInfo *tmp_info, *info;
   GdkScreen *screen = gdk_drawable_get_screen (client_window);
 
   info = NULL;
   tmp_list = open_ims;
   while (tmp_list)
     {
-      info = tmp_list->data;
-      if (info->screen == screen &&
-	  strcmp (info->locale, locale) == 0)
+      tmp_info = tmp_list->data;
+      if (tmp_info->screen == screen &&
+	  strcmp (tmp_info->locale, locale) == 0)
 	{
+	  info = tmp_info;
 	  if (info->im)
 	    return info;
 	  else
@@ -1320,7 +1321,7 @@ status_window_get (GtkIMContextXIM *cont
   screen = gdk_drawable_get_screen (toplevel_gdk);
   root_window = gdk_screen_get_root_window (screen);
   
-  while (TRUE)
+  while (toplevel_gdk)
     {
       GdkWindow *parent = gdk_window_get_parent (toplevel_gdk);
       if (parent == root_window)
