diff options
author | Tudor Brindus <me@tbrindus.ca> | 2020-06-18 22:26:27 -0400 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2020-06-19 10:02:22 +0200 |
commit | b3f08597cd725ef8136fb3cfb2808be990a6fce8 (patch) | |
tree | 316ad2bab978a00fb186300e2e11560b0610b1cb /sway/input/input-manager.c | |
parent | input/pointer: don't trigger pointer bindings for emulated input (diff) | |
download | sway-b3f08597cd725ef8136fb3cfb2808be990a6fce8.tar.gz sway-b3f08597cd725ef8136fb3cfb2808be990a6fce8.tar.zst sway-b3f08597cd725ef8136fb3cfb2808be990a6fce8.zip |
input: disable events for map_to_output devices when output not present
Fixes #3449.
Diffstat (limited to 'sway/input/input-manager.c')
-rw-r--r-- | sway/input/input-manager.c | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/sway/input/input-manager.c b/sway/input/input-manager.c index b900f666..69342c73 100644 --- a/sway/input/input-manager.c +++ b/sway/input/input-manager.c | |||
@@ -521,6 +521,22 @@ static void retranslate_keysyms(struct input_config *input_config) { | |||
521 | } | 521 | } |
522 | } | 522 | } |
523 | 523 | ||
524 | static void input_manager_configure_input( | ||
525 | struct sway_input_device *input_device) { | ||
526 | sway_input_configure_libinput_device(input_device); | ||
527 | struct sway_seat *seat = NULL; | ||
528 | wl_list_for_each(seat, &server.input->seats, link) { | ||
529 | seat_configure_device(seat, input_device); | ||
530 | } | ||
531 | } | ||
532 | |||
533 | void input_manager_configure_all_inputs(void) { | ||
534 | struct sway_input_device *input_device = NULL; | ||
535 | wl_list_for_each(input_device, &server.input->devices, link) { | ||
536 | input_manager_configure_input(input_device); | ||
537 | } | ||
538 | } | ||
539 | |||
524 | void input_manager_apply_input_config(struct input_config *input_config) { | 540 | void input_manager_apply_input_config(struct input_config *input_config) { |
525 | struct sway_input_device *input_device = NULL; | 541 | struct sway_input_device *input_device = NULL; |
526 | bool wildcard = strcmp(input_config->identifier, "*") == 0; | 542 | bool wildcard = strcmp(input_config->identifier, "*") == 0; |
@@ -531,11 +547,7 @@ void input_manager_apply_input_config(struct input_config *input_config) { | |||
531 | if (strcmp(input_device->identifier, input_config->identifier) == 0 | 547 | if (strcmp(input_device->identifier, input_config->identifier) == 0 |
532 | || wildcard | 548 | || wildcard |
533 | || type_matches) { | 549 | || type_matches) { |
534 | sway_input_configure_libinput_device(input_device); | 550 | input_manager_configure_input(input_device); |
535 | struct sway_seat *seat = NULL; | ||
536 | wl_list_for_each(seat, &server.input->seats, link) { | ||
537 | seat_configure_device(seat, input_device); | ||
538 | } | ||
539 | } | 551 | } |
540 | } | 552 | } |
541 | 553 | ||
@@ -550,7 +562,7 @@ void input_manager_reset_input(struct sway_input_device *input_device) { | |||
550 | } | 562 | } |
551 | } | 563 | } |
552 | 564 | ||
553 | void input_manager_reset_all_inputs() { | 565 | void input_manager_reset_all_inputs(void) { |
554 | struct sway_input_device *input_device = NULL; | 566 | struct sway_input_device *input_device = NULL; |
555 | wl_list_for_each(input_device, &server.input->devices, link) { | 567 | wl_list_for_each(input_device, &server.input->devices, link) { |
556 | input_manager_reset_input(input_device); | 568 | input_manager_reset_input(input_device); |
@@ -568,7 +580,6 @@ void input_manager_reset_all_inputs() { | |||
568 | } | 580 | } |
569 | } | 581 | } |
570 | 582 | ||
571 | |||
572 | void input_manager_apply_seat_config(struct seat_config *seat_config) { | 583 | void input_manager_apply_seat_config(struct seat_config *seat_config) { |
573 | sway_log(SWAY_DEBUG, "applying seat config for seat %s", seat_config->name); | 584 | sway_log(SWAY_DEBUG, "applying seat config for seat %s", seat_config->name); |
574 | if (strcmp(seat_config->name, "*") == 0) { | 585 | if (strcmp(seat_config->name, "*") == 0) { |