diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2023-01-03 13:47:54 +0100 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2023-01-03 14:58:25 +0100 |
commit | 7fab1b85adbddff7628e3e916f00677080fb9150 (patch) | |
tree | 0d7b6dd87e1d407f02d250ae6778d9f0fc51fdbf /gdk | |
parent | 5aeabdb3d404579b5cab4fff1642ed116f745a8b (diff) | |
download | gtk+-7fab1b85adbddff7628e3e916f00677080fb9150.tar.gz |
gdk/x11: Emit "remove" s-n message from gdk_toplevel_set_startup_id
In the way towards deprecating gdk_display_notify_startup_complete(),
make gdk_toplevel_set_startup_id() on X11 perform this piece of messaging
itself. It should be harmless that the message is emitted twice, if
callers do still use that API.
Diffstat (limited to 'gdk')
-rw-r--r-- | gdk/x11/gdksurface-x11.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gdk/x11/gdksurface-x11.c b/gdk/x11/gdksurface-x11.c index f32190b385..9ae867eb6f 100644 --- a/gdk/x11/gdksurface-x11.c +++ b/gdk/x11/gdksurface-x11.c @@ -2648,6 +2648,7 @@ gdk_x11_surface_set_startup_id (GdkSurface *surface, const char *startup_id) { GdkDisplay *display; + char *free_this = NULL; g_return_if_fail (GDK_IS_SURFACE (surface)); @@ -2664,6 +2665,23 @@ gdk_x11_surface_set_startup_id (GdkSurface *surface, else XDeleteProperty (GDK_DISPLAY_XDISPLAY (display), GDK_SURFACE_XID (surface), gdk_x11_get_xatom_by_name_for_display (display, "_NET_STARTUP_ID")); + + if (startup_id == NULL) + { + GdkX11Display *display_x11 = GDK_X11_DISPLAY (display); + + startup_id = free_this = display_x11->startup_notification_id; + display_x11->startup_notification_id = NULL; + + if (startup_id == NULL) + return; + } + + gdk_x11_display_broadcast_startup_message (display, "remove", + "ID", startup_id, + NULL); + + g_free (free_this); } static void |