summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2022-01-11 20:21:55 +0100
committerCarlos Garnacho <carlosg@gnome.org>2022-10-25 15:53:26 +0200
commit54348c52701e5535949e4f7212fa48024aa588c1 (patch)
tree9ab3dfb7ee2c93f16ead622af41ff674ab19a26a
parenta79d6972e08480384993d1e2046029ef9034dded (diff)
downloadgtk+-54348c52701e5535949e4f7212fa48024aa588c1.tar.gz
wayland: xdg-activation: Don't assume there's a focus surface
Tools like gtk4-launch can't set surface on the activation token so don't require it. If the compositor requires it we can't do anything about it anyway. This avoids a critical: (gtk4-launch:23497): Gdk-CRITICAL **: 17:07:24.704: gdk_wayland_surface_get_wl_surface: assertion 'GDK_IS_WAYLAND_SURFACE (surface)' failed Fixes: be4216e051 ("gdk/wayland: Support the xdg-activation wayland protocol") Signed-off-by: Guido Günther <agx@sigxcpu.org> Backport-of: 4d741bac98f906796d61eebfb4f74f5b1cecb2b6 Signed-off-by: Joan Bruguera <joanbrugueram@gmail.com>
-rw-r--r--gdk/wayland/gdkapplaunchcontext-wayland.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gdk/wayland/gdkapplaunchcontext-wayland.c b/gdk/wayland/gdkapplaunchcontext-wayland.c
index 004a390bd2..03f005884c 100644
--- a/gdk/wayland/gdkapplaunchcontext-wayland.c
+++ b/gdk/wayland/gdkapplaunchcontext-wayland.c
@@ -75,8 +75,9 @@ gdk_wayland_app_launch_context_get_startup_notify_id (GAppLaunchContext *context
xdg_activation_token_v1_set_serial (token,
_gdk_wayland_seat_get_last_implicit_grab_serial (seat, NULL),
gdk_wayland_seat_get_wl_seat (seat));
- xdg_activation_token_v1_set_surface (token,
- gdk_wayland_window_get_wl_surface (focus_window));
+ if (focus_window)
+ xdg_activation_token_v1_set_surface (token,
+ gdk_wayland_window_get_wl_surface (focus_window));
xdg_activation_token_v1_commit (token);
while (app_launch_data.token == NULL)