diff options
-rw-r--r-- | sway/commands/swap.c | 2 | ||||
-rw-r--r-- | sway/input/keyboard.c | 13 | ||||
-rw-r--r-- | sway/input/seat.c | 6 |
3 files changed, 14 insertions, 7 deletions
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, | |||
108 | container_set_fullscreen(con2, false); | 108 | container_set_fullscreen(con2, false); |
109 | } | 109 | } |
110 | 110 | ||
111 | struct sway_seat *seat = input_manager_get_default_seat(); | 111 | struct sway_seat *seat = config->handler_context.seat; |
112 | struct sway_container *focus = seat_get_focused_container(seat); | 112 | struct sway_container *focus = seat_get_focused_container(seat); |
113 | struct sway_workspace *vis1 = | 113 | struct sway_workspace *vis1 = |
114 | output_get_active_workspace(con1->workspace->output); | 114 | 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) { | |||
295 | get_active_binding(&keyboard->state_keysyms_raw, | 295 | get_active_binding(&keyboard->state_keysyms_raw, |
296 | config->current_mode->keysym_bindings, &binding, | 296 | config->current_mode->keysym_bindings, &binding, |
297 | raw_modifiers, false, input_inhibited, device_identifier); | 297 | raw_modifiers, false, input_inhibited, device_identifier); |
298 | |||
299 | if (binding) { | ||
300 | seat_execute_command(seat, binding); | ||
301 | handled = true; | ||
302 | } | ||
303 | } | 298 | } |
304 | 299 | ||
305 | // Set up (or clear) keyboard repeat for a pressed binding | 300 | // Set up (or clear) keyboard repeat for a pressed binding. Since the |
301 | // binding may remove the keyboard, the timer needs to be updated first | ||
306 | if (binding && wlr_device->keyboard->repeat_info.delay > 0) { | 302 | if (binding && wlr_device->keyboard->repeat_info.delay > 0) { |
307 | keyboard->repeat_binding = binding; | 303 | keyboard->repeat_binding = binding; |
308 | if (wl_event_source_timer_update(keyboard->key_repeat_source, | 304 | 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) { | |||
316 | } | 312 | } |
317 | } | 313 | } |
318 | 314 | ||
315 | if (binding) { | ||
316 | seat_execute_command(seat, binding); | ||
317 | handled = true; | ||
318 | } | ||
319 | |||
319 | // Compositor bindings | 320 | // Compositor bindings |
320 | if (!handled && event->state == WLR_KEY_PRESSED) { | 321 | if (!handled && event->state == WLR_KEY_PRESSED) { |
321 | handled = keyboard_execute_compositor_binding( | 322 | handled = keyboard_execute_compositor_binding( |
diff --git a/sway/input/seat.c b/sway/input/seat.c index 52790039..41a3a4df 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c | |||
@@ -428,6 +428,12 @@ static void seat_apply_input_config(struct sway_seat *seat, | |||
428 | if (mapped_to_output != NULL) { | 428 | if (mapped_to_output != NULL) { |
429 | wlr_log(WLR_DEBUG, "Mapping input device %s to output %s", | 429 | wlr_log(WLR_DEBUG, "Mapping input device %s to output %s", |
430 | sway_device->input_device->identifier, mapped_to_output); | 430 | sway_device->input_device->identifier, mapped_to_output); |
431 | if (strcmp("*", mapped_to_output) == 0) { | ||
432 | wlr_cursor_map_input_to_output(seat->cursor->cursor, | ||
433 | sway_device->input_device->wlr_device, NULL); | ||
434 | wlr_log(WLR_DEBUG, "Reset output mapping"); | ||
435 | return; | ||
436 | } | ||
431 | struct sway_output *output = output_by_name_or_id(mapped_to_output); | 437 | struct sway_output *output = output_by_name_or_id(mapped_to_output); |
432 | if (output) { | 438 | if (output) { |
433 | wlr_cursor_map_input_to_output(seat->cursor->cursor, | 439 | wlr_cursor_map_input_to_output(seat->cursor->cursor, |