[gtk] immodule: Don't load unsupported IM module



commit 545e95bb5cee04267cd77633d18121688dcff2d8
Author: Benjamin Otte <otte redhat com>
Date:   Tue Jan 8 00:25:08 2019 +0100

    immodule: Don't load unsupported IM module
    
    The code would technically allow loading the xim module when X11 support
    was not compiled in.
    
    This is probably an artificial concern, because it's pretty hard to
    compile XIM support without X11 support, but it makes the code clearer,
    so there we go.

 gtk/gtkimmodule.c | 22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtkimmodule.c b/gtk/gtkimmodule.c
index 5ebc55d4df..de88af8ba1 100644
--- a/gtk/gtkimmodule.c
+++ b/gtk/gtkimmodule.c
@@ -118,33 +118,43 @@ static gboolean
 match_backend (GdkDisplay *display,
                const char *context_id)
 {
-#ifdef GDK_WINDOWING_WAYLAND
   if (g_strcmp0 (context_id, "wayland") == 0)
     {
+#ifdef GDK_WINDOWING_WAYLAND
       return GDK_IS_WAYLAND_DISPLAY (display) &&
              gdk_wayland_display_query_registry (display,
                                                  "zwp_text_input_manager_v3");
-    }
+#else
+      return FALSE;
 #endif
+    }
 
-#ifdef GDK_WINDOWING_BROADWAY
   if (g_strcmp0 (context_id, "broadway") == 0)
+#ifdef GDK_WINDOWING_BROADWAY
     return GDK_IS_BROADWAY_DISPLAY (display);
+#else
+    return FALSE;
 #endif
 
-#ifdef GDK_WINDOWING_X11
   if (g_strcmp0 (context_id, "xim") == 0)
+#ifdef GDK_WINDOWING_X11
     return GDK_IS_X11_DISPLAY (display);
+#else
+    return FALSE;
 #endif
 
-#ifdef GDK_WINDOWING_WIN32
   if (g_strcmp0 (context_id, "ime") == 0)
+#ifdef GDK_WINDOWING_WIN32
     return GDK_IS_WIN32_DISPLAY (display);
+#else
+    return FALSE;
 #endif
 
-#ifdef GDK_WINDOWING_QUARTZ
   if (g_strcmp0 (context_id, "quartz") == 0)
+#ifdef GDK_WINDOWING_QUARTZ
     return GDK_IS_QUARTZ_DISPLAY (display);
+#else
+    return FALSE;
 #endif
 
   return TRUE;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]