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/input | |
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/input')
-rw-r--r-- | sway/input/seat.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c index 869560af..dd4d5c3b 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c @@ -775,8 +775,12 @@ void seat_set_focus_warp(struct sway_seat *seat, } } - if (container->type == C_VIEW) { - ipc_event_window(container, "focus"); + if (container) { + if (container->type == C_VIEW) { + ipc_event_window(container, "focus"); + } else if (container->type == C_WORKSPACE) { + ipc_event_workspace(NULL, container, "focus"); + } } seat->has_focus = (container != NULL); |