[gtk/wip/carlosg/startup-notification-fixes: 2/2] gdk/wayland: Preserve stored startup id for gtk_surface1.request_focus



commit ed9a6f755d5811053eba8d73e203b6f518d72536
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sun Mar 17 16:17:49 2019 +0100

    gdk/wayland: Preserve stored startup id for gtk_surface1.request_focus
    
    The use of the startup ID is now twofold, we reply back with it to end any
    corresponding startup notification, but we also use it on
    gtk_surface1.request_focus to acknowledge that the activation might raise
    the corresponding window.
    
    We should preserve the startup ID for the second to work properly, so avoid
    clearing it here. It is inconsequential if the underlying
    gtk_shell1.set_startup_id request happens multiple times on no longer existing
    startup IDs, so don't bother preventing that from happening.
    
    Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1754

 gdk/wayland/gdkdisplay-wayland.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
---
diff --git a/gdk/wayland/gdkdisplay-wayland.c b/gdk/wayland/gdkdisplay-wayland.c
index be74c93e0a..762ebfb61f 100644
--- a/gdk/wayland/gdkdisplay-wayland.c
+++ b/gdk/wayland/gdkdisplay-wayland.c
@@ -932,12 +932,10 @@ gdk_wayland_display_notify_startup_complete (GdkDisplay  *display,
                                             const gchar *startup_id)
 {
   GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display);
-  gchar *free_this = NULL;
 
   if (startup_id == NULL)
     {
-      startup_id = free_this = display_wayland->startup_notification_id;
-      display_wayland->startup_notification_id = NULL;
+      startup_id = display_wayland->startup_notification_id;
 
       if (startup_id == NULL)
         return;
@@ -945,8 +943,6 @@ gdk_wayland_display_notify_startup_complete (GdkDisplay  *display,
 
   if (display_wayland->gtk_shell)
     gtk_shell1_set_startup_id (display_wayland->gtk_shell, startup_id);
-
-  g_free (free_this);
 }
 
 static GdkKeymap *


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]