gtkwindow: Fix fallbacks through xdg_activation_v1
authorCarlos Garnacho <carlosg@gnome.org>
Wed, 1 Mar 2023 16:14:01 +0000 (17:14 +0100)
committerCarlos Garnacho <carlosg@gnome.org>
Wed, 1 Mar 2023 16:14:01 +0000 (17:14 +0100)
When activating a window, avoid the "old" gdk_notify_startup_complete*()
API that does not fallback into xdg_activation on wayland (as this is still
deferred here until show vs present happens on the surface). This was
mistakenly changed wrt the original commit backported from GTK4.

Fixes: a067938589d ("gtkwindow: Minor refactor")
gtk/gtkwindow.c

index e1b09a3658e4cc218a217f1dc66fd6d9b49cb1cb..39b01eeb66c414cc34c095ee3a7a70dc999b11b8 100644 (file)
@@ -6287,19 +6287,23 @@ gtk_window_notify_startup (GtkWindow *window)
       !GTK_IS_OFFSCREEN_WINDOW (window) &&
       priv->type != GTK_WINDOW_POPUP)
     {
+      GdkWindow *gdk_window;
+
+      gdk_window = _gtk_widget_get_window (GTK_WIDGET (window));
+
       /* Do we have a custom startup-notification id? */
       if (priv->startup_id != NULL)
         {
           /* Make sure we have a "real" id */
           if (!startup_id_is_fake (priv->startup_id))
-            gdk_notify_startup_complete_with_id (priv->startup_id);
+            gdk_window_set_startup_id (gdk_window, priv->startup_id);
 
           g_free (priv->startup_id);
           priv->startup_id = NULL;
         }
       else
         {
-          gdk_notify_startup_complete ();
+          gdk_window_set_startup_id (gdk_window, NULL);
         }
     }
 }