[gtk+] window: Set a _DBUS_APPLICATION_ID X11 window property
- From: Ryan Lortie <ryanl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] window: Set a _DBUS_APPLICATION_ID X11 window property
- Date: Mon, 19 Dec 2011 17:56:08 +0000 (UTC)
commit 9c52a73c217021be036da382adc5d70e11201215
Author: Colin Walters <walters verbum org>
Date: Fri Nov 25 17:22:16 2011 -0500
window: Set a _DBUS_APPLICATION_ID X11 window property
This will allow gnome-shell to reference it.
gtk/gtkwindow.c | 21 ++++++++++++++++++++-
1 files changed, 20 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index a64d0f3..0581679 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -2681,6 +2681,7 @@ gtk_window_set_application (GtkWindow *window,
GtkApplication *application)
{
GtkWindowPrivate *priv;
+ GdkWindow *gdkwindow;
g_return_if_fail (GTK_IS_WINDOW (window));
@@ -2700,6 +2701,22 @@ gtk_window_set_application (GtkWindow *window,
g_object_notify (G_OBJECT (window), "application");
}
+
+#ifdef GDK_WINDOWING_X11
+ gdkwindow = gtk_widget_get_window (GTK_WIDGET (window));
+ if (gdkwindow)
+ {
+ if (GDK_IS_X11_WINDOW (gdkwindow))
+ {
+ const char *id;
+ if (application)
+ id = g_application_get_application_id ((GApplication*)application);
+ else
+ id = NULL;
+ gdk_x11_window_set_utf8_property (gdkwindow, "_DBUS_APPLICATION_ID", id);
+ }
+ }
+#endif
}
/**
@@ -5201,7 +5218,7 @@ gtk_window_realize (GtkWidget *widget)
gdk_window_set_modal_hint (gdk_window, TRUE);
else
gdk_window_set_modal_hint (gdk_window, FALSE);
-
+
if (priv->startup_id)
{
#ifdef GDK_WINDOWING_X11
@@ -5224,6 +5241,8 @@ gtk_window_realize (GtkWidget *widget)
}
#endif
+ gtk_window_set_application (window, gtk_window_get_application (window));
+
/* Icons */
gtk_window_realize_icon (window);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]