From 935bda0f336bb9ca45a7fb96d7ed5f08ef04432f Mon Sep 17 00:00:00 2001 From: Dudemanguy911 Date: Fri, 11 May 2018 01:20:20 +0000 Subject: [PATCH] fix crash on fullscreen toggle --- sway/tree/view.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/sway/tree/view.c b/sway/tree/view.c index afd7eade..424c1084 100644 --- a/sway/tree/view.c +++ b/sway/tree/view.c @@ -163,13 +163,15 @@ void view_set_fullscreen_raw(struct sway_view *view, bool fullscreen) { struct sway_container *focus, *focus_ws; wl_list_for_each(seat, &input_manager->seats, link) { focus = seat_get_focus(seat); - focus_ws = focus; - if (focus_ws->type != C_WORKSPACE) { - focus_ws = container_parent(focus_ws, C_WORKSPACE); - } - seat_set_focus(seat, view->swayc); - if (focus_ws != workspace) { - seat_set_focus(seat, focus); + if (focus) { + focus_ws = focus; + if (focus && focus_ws->type != C_WORKSPACE) { + focus_ws = container_parent(focus_ws, C_WORKSPACE); + } + seat_set_focus(seat, view->swayc); + if (focus_ws != workspace) { + seat_set_focus(seat, focus); + } } } } else {