]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkimmodule.c
Fix GTK_SPINNER_CLASS macro
[~andy/gtk] / gtk / gtkimmodule.c
index 58ed584116c3df1ebac3cbfaf6e1ac511544085c..f9fce34cac20677dbeddfb2d524e28896f76d514 100644 (file)
 #include "gtkimmodule.h"
 #include "gtkimcontextsimple.h"
 #include "gtksettings.h"
-#include "gtkmain.h"
+#include "gtkmainprivate.h"
 #include "gtkrc.h"
 #include "gtkintl.h"
-#include "gtkalias.h"
 
 /* Do *not* include "gtkprivate.h" in this file. If you do, the
  * correct_libdir_prefix() and correct_localedir_prefix() functions
@@ -279,7 +278,7 @@ correct_localedir_prefix (gchar **path)
 #endif
 
 
-static GtkIMModule *
+G_GNUC_UNUSED static GtkIMModule *
 add_builtin_module (const gchar             *module_name,
                    const GtkIMContextInfo **contexts,
                    int                      n_contexts)
@@ -682,20 +681,16 @@ _gtk_im_module_get_default_context_id (GdkWindow *client_window)
 
   /* Check if the certain immodule is set in XSETTINGS.
    */
-  if (GDK_IS_DRAWABLE (client_window))
+  if (GDK_IS_WINDOW (client_window))
     {
-      screen = gdk_drawable_get_screen (GDK_DRAWABLE (client_window));
-      if (screen)
-        settings = gtk_settings_get_for_screen (screen);
-      else
-        settings = gtk_settings_get_default ();
-
+      screen = gdk_window_get_screen (client_window);
+      settings = gtk_settings_get_for_screen (screen);
       g_object_get (G_OBJECT (settings), "gtk-im-module", &tmp, NULL);
       if (tmp)
         {
           if (strcmp (tmp, SIMPLE_ID) == 0)
             context_id = SIMPLE_ID;
-          else 
+          else
             {
               GtkIMModule *module;
               module = g_hash_table_lookup (contexts_hash, tmp);
@@ -704,7 +699,7 @@ _gtk_im_module_get_default_context_id (GdkWindow *client_window)
             }
           g_free (tmp);
 
-                 if (context_id) 
+                 if (context_id)
             return context_id;
         }
     }