aboutsummaryrefslogtreecommitdiff
path: root/sway/input
diff options
context:
space:
mode:
Diffstat (limited to 'sway/input')
-rw-r--r--sway/input/cursor.c9
-rw-r--r--sway/input/keyboard.c10
-rw-r--r--sway/input/seat.c3
3 files changed, 13 insertions, 9 deletions
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 =
diff --git a/sway/input/keyboard.c b/sway/input/keyboard.c
index 9e093828..ec149d06 100644
--- a/sway/input/keyboard.c
+++ b/sway/input/keyboard.c
@@ -64,12 +64,12 @@ static void update_shortcut_state(struct sway_shortcut_state *state,
bool last_key_was_a_modifier = raw_modifiers != state->last_raw_modifiers;
state->last_raw_modifiers = raw_modifiers;
- if (event->state == WLR_KEY_PRESSED) {
- if (last_key_was_a_modifier && state->last_keycode) {
- // Last pressed key before this one was a modifier
- state_erase_key(state, state->last_keycode);
- }
+ if (last_key_was_a_modifier && state->last_keycode) {
+ // Last pressed key before this one was a modifier
+ state_erase_key(state, state->last_keycode);
+ }
+ if (event->state == WLR_KEY_PRESSED) {
// Add current key to set; there may be duplicates
state_add_key(state, event->keycode, new_key);
state->last_keycode = event->keycode;
diff --git a/sway/input/seat.c b/sway/input/seat.c
index 436d18e2..2c2087da 100644
--- a/sway/input/seat.c
+++ b/sway/input/seat.c
@@ -99,7 +99,8 @@ static void seat_send_focus(struct sway_container *con,
if (con->type == C_VIEW
&& seat_is_input_allowed(seat, con->sway_view->surface)) {
if (con->sway_view->type == SWAY_VIEW_XWAYLAND) {
- struct wlr_xwayland *xwayland = seat->input->server->xwayland;
+ struct wlr_xwayland *xwayland =
+ seat->input->server->xwayland.wlr_xwayland;
wlr_xwayland_set_seat(xwayland, seat->wlr_seat);
}
struct wlr_keyboard *keyboard = wlr_seat_get_keyboard(seat->wlr_seat);