diff options
Diffstat (limited to 'sway/input/libinput.c')
-rw-r--r-- | sway/input/libinput.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/sway/input/libinput.c b/sway/input/libinput.c index caaba5a1..4ec72882 100644 --- a/sway/input/libinput.c +++ b/sway/input/libinput.c | |||
@@ -4,6 +4,7 @@ | |||
4 | #include <wlr/backend/libinput.h> | 4 | #include <wlr/backend/libinput.h> |
5 | #include "log.h" | 5 | #include "log.h" |
6 | #include "sway/config.h" | 6 | #include "sway/config.h" |
7 | #include "sway/output.h" | ||
7 | #include "sway/input/input-manager.h" | 8 | #include "sway/input/input-manager.h" |
8 | #include "sway/ipc-server.h" | 9 | #include "sway/ipc-server.h" |
9 | 10 | ||
@@ -190,9 +191,24 @@ static bool config_libinput_pointer(struct libinput_device *device, | |||
190 | sway_log(SWAY_DEBUG, "config_libinput_pointer('%s' on '%s')", | 191 | sway_log(SWAY_DEBUG, "config_libinput_pointer('%s' on '%s')", |
191 | ic->identifier, device_id); | 192 | ic->identifier, device_id); |
192 | bool changed = false; | 193 | bool changed = false; |
193 | if (ic->send_events != INT_MIN) { | 194 | |
195 | if (ic->mapped_to_output && | ||
196 | !output_by_name_or_id(ic->mapped_to_output)) { | ||
197 | sway_log(SWAY_DEBUG, | ||
198 | "Pointer '%s' is mapped to offline output '%s'; disabling input", | ||
199 | ic->identifier, ic->mapped_to_output); | ||
200 | changed |= set_send_events(device, | ||
201 | LIBINPUT_CONFIG_SEND_EVENTS_DISABLED); | ||
202 | } else if (ic->send_events != INT_MIN) { | ||
194 | changed |= set_send_events(device, ic->send_events); | 203 | changed |= set_send_events(device, ic->send_events); |
204 | } else { | ||
205 | // Have to reset to the default mode here, otherwise if ic->send_events | ||
206 | // is unset and a mapped output just came online after being disabled, | ||
207 | // we'd remain stuck sending no events. | ||
208 | changed |= set_send_events(device, | ||
209 | libinput_device_config_send_events_get_default_mode(device)); | ||
195 | } | 210 | } |
211 | |||
196 | if (ic->tap != INT_MIN) { | 212 | if (ic->tap != INT_MIN) { |
197 | changed |= set_tap(device, ic->tap); | 213 | changed |= set_tap(device, ic->tap); |
198 | } | 214 | } |