From 9257273d84de2ef75ab505c9f954e0af6a2af78d Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Thu, 21 Sep 2023 06:59:48 +0000 Subject: [PATCH] wayland: check activation supported before activating It's possible for token to be set when the compositor doesn't support activation, and this caused a segfault. For example, this can happen when overriding WAYLAND_DISPLAY to point to a compositor that doesn't support activation, in a terminal running under one that does, and so has set XDG_ACTIVATION_TOKEN. --- wayland.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wayland.c b/wayland.c index 7fcb01c1..d5dc838f 100644 --- a/wayland.c +++ b/wayland.c @@ -1701,7 +1701,7 @@ wayl_win_init(struct terminal *term, const char *token) wl_surface_commit(win->surface.surf); /* Complete XDG startup notification */ - if (token) + if (token && wayl->xdg_activation) xdg_activation_v1_activate(wayl->xdg_activation, token, win->surface.surf); if (!wayl_win_subsurface_new(win, &win->overlay, false)) {