window: Make sure we call gdk_wayland_surface_focus
authorGuido Günther <agx@sigxcpu.org>
Wed, 25 Aug 2021 10:17:47 +0000 (12:17 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Wed, 16 Mar 2022 18:50:21 +0000 (19:50 +0100)
When using xdg_activation this is responsible for submitting
the activation token / startup id to the compositor.

gtk/gtkwindow.c

index c1673df637f2b93b598fd7fd2411a0895f954650..a658471c129be7b04435ee67c65d367516fcf793 100644 (file)
@@ -5271,14 +5271,15 @@ gtk_window_present_with_time (GtkWindow *window,
 #endif
            timestamp = gtk_get_current_event_time ();
         }
-
-      gdk_toplevel_focus (GDK_TOPLEVEL (surface), timestamp);
     }
   else
     {
       priv->initial_timestamp = timestamp;
       gtk_widget_show (widget);
     }
+
+  g_assert (priv->surface != NULL);
+  gdk_toplevel_focus (GDK_TOPLEVEL (priv->surface), timestamp);
 }
 
 /**