[gtk+] XIM: gracefully deal with non-X backends



commit ebd28de588ff2db2f5198ef742cf88fa3c4b3d40
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Dec 29 23:43:28 2011 -0500

    XIM: gracefully deal with non-X backends
    
    Patch by Young-Ho Cha, bug 660309.

 modules/input/gtkimcontextxim.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/modules/input/gtkimcontextxim.c b/modules/input/gtkimcontextxim.c
index 84f2379..3241b60 100644
--- a/modules/input/gtkimcontextxim.c
+++ b/modules/input/gtkimcontextxim.c
@@ -650,6 +650,8 @@ gtk_im_context_xim_new (void)
   GtkIMContextXIM *result;
   const gchar *charset;
 
+  if (!GDK_IS_X11_DISPLAY(gdk_display_get_default()))
+    return NULL;
   result = g_object_new (GTK_TYPE_IM_CONTEXT_XIM, NULL);
 
   result->locale = g_strdup (setlocale (LC_CTYPE, NULL));



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