aboutsummaryrefslogtreecommitdiffstats
path: root/sway/input/seatop_default.c
diff options
context:
space:
mode:
authorLibravatar Tudor Brindus <me@tbrindus.ca>2020-06-04 00:31:19 -0400
committerLibravatar Simon Ser <contact@emersion.fr>2020-06-04 10:20:32 +0200
commitf7e050c58f61a15bf5987e2e3d280a72666f6381 (patch)
tree1e5f5779746514abdd532eceae6f4a758511a170 /sway/input/seatop_default.c
parentshells: Resize on commit if geometry x/y changes (diff)
downloadsway-f7e050c58f61a15bf5987e2e3d280a72666f6381.tar.gz
sway-f7e050c58f61a15bf5987e2e3d280a72666f6381.tar.zst
sway-f7e050c58f61a15bf5987e2e3d280a72666f6381.zip
input/cursor: refactor tablet tool tip events into seatops
This commit moves tool tip event generation into seatops. In doing so, some corner cases where we'd erroneously (but likely harmlessly) generate both tablet and pointer events simultaneously are eliminated.
Diffstat (limited to 'sway/input/seatop_default.c')
-rw-r--r--sway/input/seatop_default.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sway/input/seatop_default.c b/sway/input/seatop_default.c
index 048bad75..072f4396 100644
--- a/sway/input/seatop_default.c
+++ b/sway/input/seatop_default.c
@@ -201,8 +201,12 @@ static void state_add_button(struct seatop_default_event *e, uint32_t button) {
201static void handle_tablet_tool_tip(struct sway_seat *seat, 201static void handle_tablet_tool_tip(struct sway_seat *seat,
202 struct sway_tablet_tool *tool, uint32_t time_msec, 202 struct sway_tablet_tool *tool, uint32_t time_msec,
203 enum wlr_tablet_tool_tip_state state) { 203 enum wlr_tablet_tool_tip_state state) {
204 if (state != WLR_TABLET_TOOL_TIP_DOWN) { 204 if (state == WLR_TABLET_TOOL_TIP_UP) {
205 wlr_tablet_v2_tablet_tool_notify_up(tool->tablet_v2_tool);
205 return; 206 return;
207 } else if (state == WLR_TABLET_TOOL_TIP_DOWN) {
208 wlr_tablet_v2_tablet_tool_notify_down(tool->tablet_v2_tool);
209 wlr_tablet_tool_v2_start_implicit_grab(tool->tablet_v2_tool);
206 } 210 }
207 211
208 struct sway_cursor *cursor = seat->cursor; 212 struct sway_cursor *cursor = seat->cursor;