aboutsummaryrefslogtreecommitdiff
path: root/tinywl/tinywl.c
diff options
context:
space:
mode:
Diffstat (limited to 'tinywl/tinywl.c')
-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 */