aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-09-21 06:59:48 +0000
committerAlyssa Ross <hi@alyssa.is>2023-09-21 06:59:48 +0000
commit9257273d84de2ef75ab505c9f954e0af6a2af78d (patch)
tree3e7a7a443a012a243aaf629541a46b11d8aebe3b
parentdoc: keybings default none (diff)
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.
-rw-r--r--wayland.c2
1 files changed, 1 insertions, 1 deletions
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)) {