diff options
-rw-r--r-- | sway/input/seat.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c index 8ab616de..5782478d 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <wlr/types/wlr_output_layout.h> | 11 | #include <wlr/types/wlr_output_layout.h> |
12 | #include <wlr/types/wlr_primary_selection.h> | 12 | #include <wlr/types/wlr_primary_selection.h> |
13 | #include <wlr/types/wlr_tablet_v2.h> | 13 | #include <wlr/types/wlr_tablet_v2.h> |
14 | #include <wlr/types/wlr_touch.h> | ||
14 | #include <wlr/types/wlr_xcursor_manager.h> | 15 | #include <wlr/types/wlr_xcursor_manager.h> |
15 | #include "config.h" | 16 | #include "config.h" |
16 | #include "list.h" | 17 | #include "list.h" |
@@ -725,14 +726,25 @@ static void seat_apply_input_config(struct sway_seat *seat, | |||
725 | ic == NULL ? MAPPED_TO_DEFAULT : ic->mapped_to; | 726 | ic == NULL ? MAPPED_TO_DEFAULT : ic->mapped_to; |
726 | 727 | ||
727 | switch (mapped_to) { | 728 | switch (mapped_to) { |
728 | case MAPPED_TO_DEFAULT: | 729 | case MAPPED_TO_DEFAULT:; |
729 | /* | 730 | /* |
730 | * If the wlroots backend provides an output name, use that. | 731 | * If the wlroots backend provides an output name, use that. |
731 | * | 732 | * |
732 | * Otherwise, try to map built-in touch and tablet tool devices to the | 733 | * Otherwise, try to map built-in touch and pointer devices to the |
733 | * built-in output. | 734 | * built-in output. |
734 | */ | 735 | */ |
735 | mapped_to_output = sway_device->input_device->wlr_device->output_name; | 736 | struct wlr_input_device *dev = sway_device->input_device->wlr_device; |
737 | switch (dev->type) { | ||
738 | case WLR_INPUT_DEVICE_POINTER: | ||
739 | mapped_to_output = dev->pointer->output_name; | ||
740 | break; | ||
741 | case WLR_INPUT_DEVICE_TOUCH: | ||
742 | mapped_to_output = dev->touch->output_name; | ||
743 | break; | ||
744 | default: | ||
745 | mapped_to_output = NULL; | ||
746 | break; | ||
747 | } | ||
736 | if (mapped_to_output == NULL && is_touch_or_tablet_tool(sway_device) && | 748 | if (mapped_to_output == NULL && is_touch_or_tablet_tool(sway_device) && |
737 | sway_libinput_device_is_builtin(sway_device->input_device)) { | 749 | sway_libinput_device_is_builtin(sway_device->input_device)) { |
738 | mapped_to_output = get_builtin_output_name(); | 750 | mapped_to_output = get_builtin_output_name(); |