]> Pileus Git - ~andy/gtk/commitdiff
GtkApplication: Allow passing windows on non-X11 targets
authorBastien Nocera <hadess@hadess.net>
Wed, 13 Mar 2013 14:32:46 +0000 (15:32 +0100)
committerBastien Nocera <hadess@hadess.net>
Thu, 14 Mar 2013 16:48:20 +0000 (17:48 +0100)
It's not the application's fault that we don't do anything
with the passed GtkWindow on non-X11, so don't try to get an XID
on non-X11.

https://bugzilla.gnome.org/show_bug.cgi?id=695783

gtk/gtkapplication.c

index 9072907513ffb70707d19487a01e29b763adaed1..d60584657265624f7378fd127c80585f394d2ef2 100644 (file)
@@ -1431,8 +1431,10 @@ gtk_application_inhibit (GtkApplication             *application,
       gdkwindow = gtk_widget_get_window (GTK_WIDGET (window));
       if (gdkwindow == NULL)
         g_warning ("Inhibit called with an unrealized window");
-      else
+#ifdef GDK_WINDOWING_X11
+      else if (GDK_IS_X11_WINDOW (gdkwindow))
         xid = GDK_WINDOW_XID (gdkwindow);
+#endif
     }
 
   res = g_dbus_proxy_call_sync (application->priv->sm_proxy,