diff options
author | Ryan Dwyer <RyanDwyer@users.noreply.github.com> | 2018-08-02 08:17:25 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-02 08:17:25 +1000 |
commit | 4cc0855f21a2704314aa7b8973ceae7a8b463a1a (patch) | |
tree | 92d5b04c01c2da2bce20819ade8ed834bf2e420c /sway/input/seat.c | |
parent | f078f7fdfa8c1b2549178b8137c6731c2fff6d3f (diff) | |
parent | 46cfa8ff56acff0139b2e24300cbc3ea19da723f (diff) | |
download | sway-4cc0855f21a2704314aa7b8973ceae7a8b463a1a.tar.xz |
Merge pull request #2264 from ianyfan/ipc
IPC Events (1.0)
Diffstat (limited to 'sway/input/seat.c')
-rw-r--r-- | sway/input/seat.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c index a4a449e4..fe3cbc53 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c @@ -617,7 +617,7 @@ static int handle_urgent_timeout(void *data) { } void seat_set_focus_warp(struct sway_seat *seat, - struct sway_container *container, bool warp) { + struct sway_container *container, bool warp, bool notify) { if (seat->focused_layer) { return; } @@ -739,7 +739,9 @@ void seat_set_focus_warp(struct sway_seat *seat, if (last_focus) { if (last_workspace) { - ipc_event_workspace(last_workspace, container, "focus"); + if (notify && last_workspace != new_workspace) { + ipc_event_workspace(last_workspace, new_workspace, "focus"); + } if (!workspace_is_visible(last_workspace) && workspace_is_empty(last_workspace)) { if (last_workspace == last_focus) { @@ -766,6 +768,10 @@ void seat_set_focus_warp(struct sway_seat *seat, } } + if (container->type == C_VIEW) { + ipc_event_window(container, "focus"); + } + seat->has_focus = (container != NULL); update_debug_tree(); @@ -773,7 +779,7 @@ void seat_set_focus_warp(struct sway_seat *seat, void seat_set_focus(struct sway_seat *seat, struct sway_container *container) { - seat_set_focus_warp(seat, container, true); + seat_set_focus_warp(seat, container, true, true); } void seat_set_focus_surface(struct sway_seat *seat, |