diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-05-02 09:00:26 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2018-05-02 09:00:26 -0400 |
commit | 52aa245b246078a20475edce7d4b6e013d1d99e4 (patch) | |
tree | 6ffd7fcc8e249ce00c223c04fbbee1bfe3b314ce /sway/input/seat.c | |
parent | Fixed #1888 GCC cannot compile due to uninitialized variables (#1889) (diff) | |
download | sway-52aa245b246078a20475edce7d4b6e013d1d99e4.tar.gz sway-52aa245b246078a20475edce7d4b6e013d1d99e4.tar.zst sway-52aa245b246078a20475edce7d4b6e013d1d99e4.zip |
Implement basic touch support
This required changing container_at_cursor to container_at_coords so
that we could get the appropriate surface (and sx/xy) without moving the
cursor.
Future work:
- Simulate a cursor for clients which have not bound to wl_touch
- Keep sending motion events when moving outside the surface (#1892)
- Bind gestures to sway commands
Diffstat (limited to 'sway/input/seat.c')
-rw-r--r-- | sway/input/seat.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c index 8b9817da..e8bd6b36 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c | |||
@@ -315,6 +315,13 @@ static void seat_configure_keyboard(struct sway_seat *seat, | |||
315 | } | 315 | } |
316 | } | 316 | } |
317 | 317 | ||
318 | static void seat_configure_touch(struct sway_seat *seat, | ||
319 | struct sway_seat_device *sway_device) { | ||
320 | wlr_cursor_attach_input_device(seat->cursor->cursor, | ||
321 | sway_device->input_device->wlr_device); | ||
322 | seat_apply_input_config(seat, sway_device); | ||
323 | } | ||
324 | |||
318 | static void seat_configure_tablet_tool(struct sway_seat *seat, | 325 | static void seat_configure_tablet_tool(struct sway_seat *seat, |
319 | struct sway_seat_device *sway_device) { | 326 | struct sway_seat_device *sway_device) { |
320 | wlr_cursor_attach_input_device(seat->cursor->cursor, | 327 | wlr_cursor_attach_input_device(seat->cursor->cursor, |
@@ -349,12 +356,14 @@ void seat_configure_device(struct sway_seat *seat, | |||
349 | case WLR_INPUT_DEVICE_KEYBOARD: | 356 | case WLR_INPUT_DEVICE_KEYBOARD: |
350 | seat_configure_keyboard(seat, seat_device); | 357 | seat_configure_keyboard(seat, seat_device); |
351 | break; | 358 | break; |
359 | case WLR_INPUT_DEVICE_TOUCH: | ||
360 | seat_configure_touch(seat, seat_device); | ||
361 | break; | ||
352 | case WLR_INPUT_DEVICE_TABLET_TOOL: | 362 | case WLR_INPUT_DEVICE_TABLET_TOOL: |
353 | seat_configure_tablet_tool(seat, seat_device); | 363 | seat_configure_tablet_tool(seat, seat_device); |
354 | break; | 364 | break; |
355 | case WLR_INPUT_DEVICE_TABLET_PAD: | 365 | case WLR_INPUT_DEVICE_TABLET_PAD: |
356 | case WLR_INPUT_DEVICE_TOUCH: | 366 | wlr_log(L_DEBUG, "TODO: configure tablet pad"); |
357 | wlr_log(L_DEBUG, "TODO: configure other devices"); | ||
358 | break; | 367 | break; |
359 | } | 368 | } |
360 | } | 369 | } |