From 9e2d936b4adb4936d86ae6c2420d7248787043d1 Mon Sep 17 00:00:00 2001 From: emersion Date: Fri, 22 Dec 2017 15:06:12 +0100 Subject: [PATCH] Fix rootston seat button count --- rootston/cursor.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/rootston/cursor.c b/rootston/cursor.c index 95e8ce2a..ad15989d 100644 --- a/rootston/cursor.c +++ b/rootston/cursor.c @@ -166,6 +166,13 @@ static void roots_cursor_press_button(struct roots_cursor *cursor, } return; } + if (state == WLR_BUTTON_RELEASED && + cursor->mode != ROOTS_CURSOR_PASSTHROUGH) { + cursor->mode = ROOTS_CURSOR_PASSTHROUGH; + if (seat->seat->pointer_state.button_count == 0) { + return; + } + } uint32_t serial; if (is_touch) { @@ -178,7 +185,6 @@ static void roots_cursor_press_button(struct roots_cursor *cursor, int i; switch (state) { case WLR_BUTTON_RELEASED: - seat->cursor->mode = ROOTS_CURSOR_PASSTHROUGH; if (!is_touch) { roots_cursor_update_position(cursor, time); }