diff options
Diffstat (limited to 'sway/input/seat.c')
-rw-r--r-- | sway/input/seat.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c index a8df5b99..09acab0d 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c | |||
@@ -405,6 +405,14 @@ static void seat_update_capabilities(struct sway_seat *seat) { | |||
405 | } | 405 | } |
406 | } | 406 | } |
407 | 407 | ||
408 | static void seat_reset_input_config(struct sway_seat *seat, | ||
409 | struct sway_seat_device *sway_device) { | ||
410 | wlr_log(WLR_DEBUG, "Resetting output mapping for input device %s", | ||
411 | sway_device->input_device->identifier); | ||
412 | wlr_cursor_map_input_to_output(seat->cursor->cursor, | ||
413 | sway_device->input_device->wlr_device, NULL); | ||
414 | } | ||
415 | |||
408 | static void seat_apply_input_config(struct sway_seat *seat, | 416 | static void seat_apply_input_config(struct sway_seat *seat, |
409 | struct sway_seat_device *sway_device) { | 417 | struct sway_seat_device *sway_device) { |
410 | const char *mapped_to_output = NULL; | 418 | const char *mapped_to_output = NULL; |
@@ -522,6 +530,35 @@ void seat_configure_device(struct sway_seat *seat, | |||
522 | } | 530 | } |
523 | } | 531 | } |
524 | 532 | ||
533 | void seat_reset_device(struct sway_seat *seat, | ||
534 | struct sway_input_device *input_device) { | ||
535 | struct sway_seat_device *seat_device = seat_get_device(seat, input_device); | ||
536 | if (!seat_device) { | ||
537 | return; | ||
538 | } | ||
539 | |||
540 | switch (input_device->wlr_device->type) { | ||
541 | case WLR_INPUT_DEVICE_POINTER: | ||
542 | seat_reset_input_config(seat, seat_device); | ||
543 | break; | ||
544 | case WLR_INPUT_DEVICE_KEYBOARD: | ||
545 | sway_keyboard_configure(seat_device->keyboard); | ||
546 | break; | ||
547 | case WLR_INPUT_DEVICE_TOUCH: | ||
548 | seat_reset_input_config(seat, seat_device); | ||
549 | break; | ||
550 | case WLR_INPUT_DEVICE_TABLET_TOOL: | ||
551 | seat_reset_input_config(seat, seat_device); | ||
552 | break; | ||
553 | case WLR_INPUT_DEVICE_TABLET_PAD: | ||
554 | wlr_log(WLR_DEBUG, "TODO: reset tablet pad"); | ||
555 | break; | ||
556 | case WLR_INPUT_DEVICE_SWITCH: | ||
557 | wlr_log(WLR_DEBUG, "TODO: reset switch device"); | ||
558 | break; | ||
559 | } | ||
560 | } | ||
561 | |||
525 | void seat_add_device(struct sway_seat *seat, | 562 | void seat_add_device(struct sway_seat *seat, |
526 | struct sway_input_device *input_device) { | 563 | struct sway_input_device *input_device) { |
527 | if (seat_get_device(seat, input_device)) { | 564 | if (seat_get_device(seat, input_device)) { |