diff options
author | Thiago Mendes <thiago@posteo.de> | 2018-10-10 23:15:31 +0200 |
---|---|---|
committer | Thiago Mendes <thiago@posteo.de> | 2018-10-10 23:15:31 +0200 |
commit | 8e147b3f1d579fbe18ec80a851a699ed7927e410 (patch) | |
tree | 2eb8331b33caab9266fe436a5b6a33c8d7a5c1e9 /sway/input | |
parent | 5d19906556fe27dd9f2ee12a819cc14dd33e3fea (diff) |
Add libinput send_events config for touch
Diffstat (limited to 'sway/input')
-rw-r--r-- | sway/input/input-manager.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/sway/input/input-manager.c b/sway/input/input-manager.c index 3c7b74d2..70c2abf7 100644 --- a/sway/input/input-manager.c +++ b/sway/input/input-manager.c @@ -116,6 +116,28 @@ static void input_manager_libinput_config_keyboard( } } +static void input_manager_libinput_config_touch( + struct sway_input_device *input_device) { + struct wlr_input_device *wlr_device = input_device->wlr_device; + struct input_config *ic = input_device_get_config(input_device); + struct libinput_device *libinput_device; + + if (!ic || !wlr_input_device_is_libinput(wlr_device)) { + return; + } + + libinput_device = wlr_libinput_get_device_handle(wlr_device); + wlr_log(WLR_DEBUG, "input_manager_libinput_config_touch(%s)", + ic->identifier); + + if (ic->send_events != INT_MIN) { + wlr_log(WLR_DEBUG, "libinput_config_touch(%s) send_events_set_mode(%d)", + ic->identifier, ic->send_events); + libinput_device_config_send_events_set_mode(libinput_device, + ic->send_events); + } +} + static void input_manager_libinput_config_pointer( struct sway_input_device *input_device) { struct wlr_input_device *wlr_device = input_device->wlr_device; @@ -267,6 +289,8 @@ static void handle_new_input(struct wl_listener *listener, void *data) { input_manager_libinput_config_pointer(input_device); } else if (input_device->wlr_device->type == WLR_INPUT_DEVICE_KEYBOARD) { input_manager_libinput_config_keyboard(input_device); + } else if (input_device->wlr_device->type == WLR_INPUT_DEVICE_TOUCH) { + input_manager_libinput_config_touch(input_device); } wl_signal_add(&device->events.destroy, &input_device->device_destroy); @@ -430,6 +454,8 @@ void input_manager_apply_input_config(struct sway_input_manager *input, input_manager_libinput_config_pointer(input_device); } else if (input_device->wlr_device->type == WLR_INPUT_DEVICE_KEYBOARD) { input_manager_libinput_config_keyboard(input_device); + } else if (input_device->wlr_device->type == WLR_INPUT_DEVICE_TOUCH) { + input_manager_libinput_config_touch(input_device); } struct sway_seat *seat = NULL; |