From 1e0459f7f7a6a266f7c65ba638db3fe3f4a53635 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Fri, 31 Aug 2018 19:49:12 +1000 Subject: Fix crash when running deferred commands Fixes #2541 --- sway/input/seat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sway/input') diff --git a/sway/input/seat.c b/sway/input/seat.c index 36e1d232..6a6e3096 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c @@ -635,7 +635,7 @@ void seat_set_focus_warp(struct sway_seat *seat, // find new output's old workspace, which might have to be removed if empty struct sway_container *new_output_last_ws = NULL; - if (last_output != new_output) { + if (new_output && last_output != new_output) { new_output_last_ws = seat_get_active_child(seat, new_output); } -- cgit v1.2.3 From dce549c5378d5d572b8996a7873629df63c45259 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Fri, 31 Aug 2018 21:34:16 +1000 Subject: Don't send never-ending transactions when a focused layer surface commits This moves the arrange_windows call into the arrange_layers function, where we know the output actually needs to be arranged. Additionally, we shouldn't set focus to the parent of an unknown container type, because the parent may be an output and this causes a crash because outputs can't have direct focus. Fixes #2543 --- sway/desktop/layer_shell.c | 3 +-- sway/input/seat.c | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'sway/input') diff --git a/sway/desktop/layer_shell.c b/sway/desktop/layer_shell.c index 1fae5db2..a4f7f928 100644 --- a/sway/desktop/layer_shell.c +++ b/sway/desktop/layer_shell.c @@ -176,7 +176,7 @@ void arrange_layers(struct sway_output *output) { sizeof(struct wlr_box)) != 0) { wlr_log(WLR_DEBUG, "Usable area changed, rearranging output"); memcpy(&output->usable_area, &usable_area, sizeof(struct wlr_box)); - container_set_dirty(output->swayc); + arrange_output(output->swayc); } // Arrange non-exlusive surfaces from top->bottom @@ -247,7 +247,6 @@ static void handle_surface_commit(struct wl_listener *listener, void *data) { layer_surface->surface, false); } - arrange_windows(output->swayc); transaction_commit_dirty(); } diff --git a/sway/input/seat.c b/sway/input/seat.c index 36e1d232..5af9e88a 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c @@ -779,7 +779,7 @@ void seat_set_focus_layer(struct sway_seat *seat, wlr_log(WLR_DEBUG, "Returning focus to %p %s '%s'", previous, container_type_to_str(previous->type), previous->name); // Hack to get seat to re-focus the return value of get_focus - seat_set_focus(seat, previous->parent); + seat_set_focus(seat, NULL); seat_set_focus(seat, previous); } return; -- cgit v1.2.3