diff options
author | 2018-07-18 21:55:14 +0100 | |
---|---|---|
committer | 2018-08-01 16:57:15 +0100 | |
commit | 03eaf444a4a432e5712d40f93d849b51d2028b63 (patch) | |
tree | ab593f6a5157668ed8515c0af211b7b8c1d37b1c /sway/input/cursor.c | |
parent | ipc: fix workspace::focus event behaviour (diff) | |
download | sway-03eaf444a4a432e5712d40f93d849b51d2028b63.tar.gz sway-03eaf444a4a432e5712d40f93d849b51d2028b63.tar.zst sway-03eaf444a4a432e5712d40f93d849b51d2028b63.zip |
ipc: prevent emitting a workspace::focus event when moving a container to a different workspace or output
When a container is moved from, say, workspace 1 to workspace 2, workspace 2 is focused in order to arrange the windows before focus is moved back to workspace 1, which caused a workspace:focus event from workspace 2 to workspace 1 to be emitted. This commit inhibits that event.
Diffstat (limited to 'sway/input/cursor.c')
-rw-r--r-- | sway/input/cursor.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sway/input/cursor.c b/sway/input/cursor.c index 96ac7b33..d6fdc1da 100644 --- a/sway/input/cursor.c +++ b/sway/input/cursor.c | |||
@@ -349,7 +349,7 @@ void cursor_send_pointer_motion(struct sway_cursor *cursor, uint32_t time_msec, | |||
349 | output = container_parent(c, C_OUTPUT); | 349 | output = container_parent(c, C_OUTPUT); |
350 | } | 350 | } |
351 | if (output != focus) { | 351 | if (output != focus) { |
352 | seat_set_focus_warp(seat, c, false); | 352 | seat_set_focus_warp(seat, c, false, true); |
353 | } | 353 | } |
354 | } else if (c->type == C_VIEW) { | 354 | } else if (c->type == C_VIEW) { |
355 | // Focus c if the following are true: | 355 | // Focus c if the following are true: |
@@ -359,13 +359,13 @@ void cursor_send_pointer_motion(struct sway_cursor *cursor, uint32_t time_msec, | |||
359 | if (!wlr_seat_keyboard_has_grab(cursor->seat->wlr_seat) && | 359 | if (!wlr_seat_keyboard_has_grab(cursor->seat->wlr_seat) && |
360 | c != prev_c && | 360 | c != prev_c && |
361 | view_is_visible(c->sway_view)) { | 361 | view_is_visible(c->sway_view)) { |
362 | seat_set_focus_warp(seat, c, false); | 362 | seat_set_focus_warp(seat, c, false, true); |
363 | } else { | 363 | } else { |
364 | struct sway_container *next_focus = | 364 | struct sway_container *next_focus = |
365 | seat_get_focus_inactive(seat, &root_container); | 365 | seat_get_focus_inactive(seat, &root_container); |
366 | if (next_focus && next_focus->type == C_VIEW && | 366 | if (next_focus && next_focus->type == C_VIEW && |
367 | view_is_visible(next_focus->sway_view)) { | 367 | view_is_visible(next_focus->sway_view)) { |
368 | seat_set_focus_warp(seat, next_focus, false); | 368 | seat_set_focus_warp(seat, next_focus, false, true); |
369 | } | 369 | } |
370 | } | 370 | } |
371 | } | 371 | } |