From b9e9e0e1333a10deaba7679066382b9dc4790d31 Mon Sep 17 00:00:00 2001 From: Justus Rossmeier Date: Mon, 8 Feb 2021 00:36:56 +0100 Subject: [PATCH] tablet_v2: Fix implicit grab end detection Store the previously focused surface in `state->focused` as well as in `state->original` when starting an implicit grab. That way at the end of an implicit grab, the detection whether the grab started and ended on the same surface works as intended, even if the original surface was never left at all. --- types/tablet_v2/wlr_tablet_v2_tool.c | 1 + 1 file changed, 1 insertion(+) diff --git a/types/tablet_v2/wlr_tablet_v2_tool.c b/types/tablet_v2/wlr_tablet_v2_tool.c index 48348197..5ef19be8 100644 --- a/types/tablet_v2/wlr_tablet_v2_tool.c +++ b/types/tablet_v2/wlr_tablet_v2_tool.c @@ -848,6 +848,7 @@ void wlr_tablet_tool_v2_start_implicit_grab( } state->original = tool->focused_surface; + state->focused = tool->focused_surface; grab->data = state; wlr_tablet_tool_v2_start_grab(tool, grab);