From f7e050c58f61a15bf5987e2e3d280a72666f6381 Mon Sep 17 00:00:00 2001 From: Tudor Brindus Date: Thu, 4 Jun 2020 00:31:19 -0400 Subject: 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. --- sway/input/seatop_default.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'sway/input/seatop_default.c') 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) { static void handle_tablet_tool_tip(struct sway_seat *seat, struct sway_tablet_tool *tool, uint32_t time_msec, enum wlr_tablet_tool_tip_state state) { - if (state != WLR_TABLET_TOOL_TIP_DOWN) { + if (state == WLR_TABLET_TOOL_TIP_UP) { + wlr_tablet_v2_tablet_tool_notify_up(tool->tablet_v2_tool); return; + } else if (state == WLR_TABLET_TOOL_TIP_DOWN) { + wlr_tablet_v2_tablet_tool_notify_down(tool->tablet_v2_tool); + wlr_tablet_tool_v2_start_implicit_grab(tool->tablet_v2_tool); } struct sway_cursor *cursor = seat->cursor; -- cgit v1.2.3