diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-08-02 21:55:37 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-08-02 21:55:37 +1000 |
commit | 9339026a31103b453545cf65cd45f345e44d0437 (patch) | |
tree | afeaa5fc41b11ac8ef4e1cc0fc31efe6b6f723f5 /sway/tree | |
parent | d6095588a143710d25be47577ea65517770e7a74 (diff) | |
download | sway-9339026a31103b453545cf65cd45f345e44d0437.tar.xz |
Fix focus related crashes
* seat_set_focus_warp lacked a container NULL check
* view mapping code needs to use seat_get_focus_inactive
Also, seat_set_focus_warp triggered the wrong IPC event if focus was a
workspace, which resulted in swaybar not showing the workspace as
active.
Diffstat (limited to 'sway/tree')
-rw-r--r-- | sway/tree/view.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c index 051b93ce..97318daa 100644 --- a/sway/tree/view.c +++ b/sway/tree/view.c @@ -496,7 +496,7 @@ static struct sway_container *select_workspace(struct sway_view *view) { } // Use the focused workspace - ws = seat_get_focus(seat); + ws = seat_get_focus_inactive(seat, &root_container); if (ws->type != C_WORKSPACE) { ws = container_parent(ws, C_WORKSPACE); } @@ -505,7 +505,8 @@ static struct sway_container *select_workspace(struct sway_view *view) { static bool should_focus(struct sway_view *view) { struct sway_seat *seat = input_manager_current_seat(input_manager); - struct sway_container *prev_focus = seat_get_focus(seat); + struct sway_container *prev_focus = + seat_get_focus_inactive(seat, &root_container); struct sway_container *prev_ws = prev_focus->type == C_WORKSPACE ? prev_focus : container_parent(prev_focus, C_WORKSPACE); struct sway_container *map_ws = container_parent(view->swayc, C_WORKSPACE); |