immmodule: Warn if GTK_IM_MODULE is bad
authorMatthias Clasen <mclasen@redhat.com>
Fri, 18 Nov 2022 16:09:14 +0000 (11:09 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 18 Nov 2022 16:18:48 +0000 (11:18 -0500)
If we don't find an immodule matching the
ids in the GTK_IM_MODULE envvar, print a
warning.

gtk/gtkimmodule.c

index 6ef4a3a179a8d4fdfcd72a286d3a80dabc0e13ef..00f199dbf8e4d29c6c06a7f2814418ffbb0cd8ae 100644 (file)
@@ -199,6 +199,16 @@ _gtk_im_module_get_default_context_id (GdkDisplay *display)
 
       if (context_id)
         return context_id;
+      else
+        {
+          static gboolean warned;
+
+          if (!warned)
+            {
+              g_warning ("No IM module matching GTK_IM_MODULE=%s found", envvar);
+              warned = TRUE;
+            }
+        }
     }
 
   /* Check if the certain immodule is set in XSETTINGS. */