mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-05 02:11:08 +00:00
window: Set a _DBUS_APPLICATION_ID X11 window property
This will allow gnome-shell to reference it.
This commit is contained in:
parent
ff38dda9a8
commit
9c52a73c21
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user