immodule: Accept 'simple' and 'none'
authorMatthias Clasen <mclasen@redhat.com>
Fri, 18 Nov 2022 16:17:20 +0000 (11:17 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 18 Nov 2022 16:18:48 +0000 (11:18 -0500)
Everybody (including myself) gets this wrong,
so accept 'simple' and 'none' as shorthands
for the official IDs 'gtk-im-context-simple'
and 'gtk-im-context-none'.

gtk/gtkimmodule.c

index 00f199dbf8e4d29c6c06a7f2814418ffbb0cd8ae..e0189573a9014e623df7ced2199aa970157b8f7e 100644 (file)
 #include <windows.h>
 #endif
 
-#define SIMPLE_ID "gtk-im-context-simple"
-#define NONE_ID   "gtk-im-context-none"
+#define SIMPLE_ID     "gtk-im-context-simple"
+#define ALT_SIMPLE_ID "simple"
+#define NONE_ID       "gtk-im-context-none"
+#define ALT_NONE_ID   "none"
 
 /**
  * _gtk_im_module_create:
@@ -151,9 +153,11 @@ lookup_immodule (GdkDisplay  *display,
       if (!match_backend (display, immodules_list[i]))
         continue;
 
-      if (g_strcmp0 (immodules_list[i], SIMPLE_ID) == 0)
+      if (g_strcmp0 (immodules_list[i], SIMPLE_ID) == 0 ||
+          g_strcmp0 (immodules_list[i], ALT_SIMPLE_ID) == 0)
         return SIMPLE_ID;
-      else if (g_strcmp0 (immodules_list[i], NONE_ID) == 0)
+      else if (g_strcmp0 (immodules_list[i], NONE_ID) == 0 ||
+               g_strcmp0 (immodules_list[i], ALT_NONE_ID) == 0)
         return NONE_ID;
       else
         {