aboutsummaryrefslogtreecommitdiff
path: root/tinywl
diff options
context:
space:
mode:
authorKirill Primak <vyivel@eclair.cafe>2023-07-26 10:50:09 +0300
committerSimon Ser <contact@emersion.fr>2023-08-21 16:30:29 +0000
commit10ba8ebc7050d4290fa5bd9bbd3ed771c266afe3 (patch)
treec6e280ba8d800ff24aa0ad1beca270cfc1639d5f /tinywl
parentf0cc712af14d9eae7cd8c56e74ae3b2547ff8ea2 (diff)
Don't assume xdg_surface.{toplevel,popup} is non-NULL
This assumption will become incorrect with future commits.
Diffstat (limited to 'tinywl')
-rw-r--r--tinywl/tinywl.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tinywl/tinywl.c b/tinywl/tinywl.c
index 61c08928..e91ad283 100644
--- a/tinywl/tinywl.c
+++ b/tinywl/tinywl.c
@@ -122,7 +122,9 @@ static void focus_view(struct tinywl_view *view, struct wlr_surface *surface) {
struct wlr_xdg_surface *previous =
wlr_xdg_surface_try_from_wlr_surface(seat->keyboard_state.focused_surface);
assert(previous != NULL && previous->role == WLR_XDG_SURFACE_ROLE_TOPLEVEL);
- wlr_xdg_toplevel_set_activated(previous->toplevel, false);
+ if (previous->toplevel != NULL) {
+ wlr_xdg_toplevel_set_activated(previous->toplevel, false);
+ }
}
struct wlr_keyboard *keyboard = wlr_seat_get_keyboard(seat);
/* Move the view to the front */