From e9ad10c2d62146784d7c40015d5ea2a8b5b68865 Mon Sep 17 00:00:00 2001 From: Tony Crisci Date: Sun, 24 Jun 2018 20:30:43 -0400 Subject: dont focus-follow-mouse when keyboard grab --- sway/input/cursor.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'sway/input') diff --git a/sway/input/cursor.c b/sway/input/cursor.c index 37a87756..944e35aa 100644 --- a/sway/input/cursor.c +++ b/sway/input/cursor.c @@ -174,10 +174,13 @@ void cursor_send_pointer_motion(struct sway_cursor *cursor, uint32_t time_msec, seat_set_focus_warp(seat, c, false); } } else if (c->type == C_VIEW) { - // Focus c if both of the following are true: + // Focus c if the following are true: // - cursor is over a new view, i.e. entered a new window; and - // - the new view is visible, i.e. not hidden in a stack or tab. - if (c != prev_c && view_is_visible(c->sway_view)) { + // - the new view is visible, i.e. not hidden in a stack or tab; and + // - the seat does not have a keyboard grab + if (!wlr_seat_keyboard_has_grab(cursor->seat->wlr_seat) && + c != prev_c && + view_is_visible(c->sway_view)) { seat_set_focus_warp(seat, c, false); } else { struct sway_container *next_focus = -- cgit v1.2.3-54-g00ecf