aboutsummaryrefslogtreecommitdiff
path: root/sway
diff options
context:
space:
mode:
Diffstat (limited to 'sway')
-rw-r--r--sway/commands/bind.c3
-rw-r--r--sway/commands/swap.c2
-rw-r--r--sway/input/keyboard.c13
3 files changed, 9 insertions, 9 deletions
diff --git a/sway/commands/bind.c b/sway/commands/bind.c
index 5990166a..7994ab2f 100644
--- a/sway/commands/bind.c
+++ b/sway/commands/bind.c
@@ -312,8 +312,7 @@ struct cmd_results *cmd_bindcode(int argc, char **argv) {
void seat_execute_command(struct sway_seat *seat, struct sway_binding *binding) {
wlr_log(WLR_DEBUG, "running command for binding: %s", binding->command);
- config->handler_context.seat = seat;
- list_t *res_list = execute_command(binding->command, NULL, NULL);
+ list_t *res_list = execute_command(binding->command, seat, NULL);
bool success = true;
for (int i = 0; i < res_list->length; ++i) {
struct cmd_results *results = res_list->items[i];
diff --git a/sway/commands/swap.c b/sway/commands/swap.c
index 08860264..670d6bca 100644
--- a/sway/commands/swap.c
+++ b/sway/commands/swap.c
@@ -108,7 +108,7 @@ static void container_swap(struct sway_container *con1,
container_set_fullscreen(con2, false);
}
- struct sway_seat *seat = input_manager_get_default_seat();
+ struct sway_seat *seat = config->handler_context.seat;
struct sway_container *focus = seat_get_focused_container(seat);
struct sway_workspace *vis1 =
output_get_active_workspace(con1->workspace->output);
diff --git a/sway/input/keyboard.c b/sway/input/keyboard.c
index c1b53237..46286410 100644
--- a/sway/input/keyboard.c
+++ b/sway/input/keyboard.c
@@ -295,14 +295,10 @@ static void handle_keyboard_key(struct wl_listener *listener, void *data) {
get_active_binding(&keyboard->state_keysyms_raw,
config->current_mode->keysym_bindings, &binding,
raw_modifiers, false, input_inhibited, device_identifier);
-
- if (binding) {
- seat_execute_command(seat, binding);
- handled = true;
- }
}
- // Set up (or clear) keyboard repeat for a pressed binding
+ // Set up (or clear) keyboard repeat for a pressed binding. Since the
+ // binding may remove the keyboard, the timer needs to be updated first
if (binding && wlr_device->keyboard->repeat_info.delay > 0) {
keyboard->repeat_binding = binding;
if (wl_event_source_timer_update(keyboard->key_repeat_source,
@@ -316,6 +312,11 @@ static void handle_keyboard_key(struct wl_listener *listener, void *data) {
}
}
+ if (binding) {
+ seat_execute_command(seat, binding);
+ handled = true;
+ }
+
// Compositor bindings
if (!handled && event->state == WLR_KEY_PRESSED) {
handled = keyboard_execute_compositor_binding(