]> Pileus Git - ~andy/gtk/commitdiff
immodule: Fix context ID lookup on module with multiple contexts
authorChangwoo Ryu <cwryu@debian.org>
Wed, 13 Feb 2013 02:44:00 +0000 (02:44 +0000)
committerChangwoo Ryu <cwryu@debian.org>
Sat, 16 Feb 2013 01:04:47 +0000 (10:04 +0900)
https://bugzilla.gnome.org/show_bug.cgi?id=690247

gtk/gtkimmodule.c

index 0f45847c61110eb4886338c2ffb21117753f2017..5e35498a224191e39cce3969ce277fdc85476074 100644 (file)
@@ -646,12 +646,14 @@ lookup_immodule (gchar **immodules_list)
       if (g_strcmp0 (*immodules_list, SIMPLE_ID) == 0)
         return SIMPLE_ID;
       else
-       {
-         GtkIMModule *module;
-         module = g_hash_table_lookup (contexts_hash, *immodules_list);
-         if (module)
-           return module->contexts[0]->context_id;
-       }
+       {
+         gboolean found;
+         gchar *context_id;
+         found = g_hash_table_lookup_extended (contexts_hash, *immodules_list,
+                                               &context_id, NULL);
+         if (found)
+           return context_id;
+       }
       immodules_list++;
     }