diff options
author | Tudor Brindus <me@tbrindus.ca> | 2020-04-25 17:57:47 -0400 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2020-05-02 13:32:28 +0200 |
commit | ae3ec745f84c1efb643d61c0fc9a345745c07da5 (patch) | |
tree | a5474c0678329d1a8ae826fd484754c65f561254 /sway/input/cursor.c | |
parent | 9362003cbaf228247d3f7a44af73c61f532cf893 (diff) |
input: refactor tablet motion into seatop handler
This commit moves tablet motion logic into a seatop handler.
As a side-effect of seatop implementations being able to receive
tablet motion events, fixes #5232.
Diffstat (limited to 'sway/input/cursor.c')
-rw-r--r-- | sway/input/cursor.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/sway/input/cursor.c b/sway/input/cursor.c index 1827c744..b38b62c8 100644 --- a/sway/input/cursor.c +++ b/sway/input/cursor.c @@ -541,25 +541,17 @@ static void handle_tablet_tool_position(struct sway_cursor *cursor, double sx, sy; struct wlr_surface *surface = NULL; struct sway_seat *seat = cursor->seat; - struct sway_node *focused_node = node_at_coords(seat, cursor->cursor->x, - cursor->cursor->y, &surface, &sx, &sy); + node_at_coords(seat, cursor->cursor->x, cursor->cursor->y, &surface, &sx, &sy); struct sway_tablet_tool *sway_tool = tool->data; - if (!surface || !wlr_surface_accepts_tablet_v2(tablet->tablet_v2, surface)) { + if (surface && wlr_surface_accepts_tablet_v2(tablet->tablet_v2, surface)) { + seatop_tablet_tool_motion(seat, tablet, sway_tool, time_msec, dx, dy); + } else { wlr_tablet_v2_tablet_tool_notify_proximity_out(sway_tool->tablet_v2_tool); pointer_motion(cursor, time_msec, input_device->wlr_device, dx, dy, dx, dy); - transaction_commit_dirty(); - return; - } - - wlr_tablet_v2_tablet_tool_notify_proximity_in(sway_tool->tablet_v2_tool, - tablet->tablet_v2, surface); - - if (focused_node && config->focus_follows_mouse != FOLLOWS_NO) { - seat_set_focus(seat, focused_node); } - wlr_tablet_v2_tablet_tool_notify_motion(sway_tool->tablet_v2_tool, sx, sy); + transaction_commit_dirty(); } static void handle_tool_axis(struct wl_listener *listener, void *data) { |