From 325ad6dd4e950546514448a838ce03027103d0bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Thu, 25 Nov 2021 15:21:53 +0100 Subject: [PATCH] input: finalize mouse selection on a pointer-leave event on the GRID surface If a mouse selection was ongoing, and the user switched workspace (probably using the keyboard...), and then back, the selection was still treated as ongoing, while all other mouse state has been reset. This meant the user had to tap at least once to stop the selection. --- CHANGELOG.md | 5 +++++ input.c | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a2255c08..b506aafa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,11 @@ ### Deprecated ### Removed ### Fixed + +* An ongoing mouse selection is now finalized on a pointer leave event + (for example by switching workspace while doing a mouse selection). + + ### Security ### Contributors diff --git a/input.c b/input.c index 0aef43cc..02035909 100644 --- a/input.c +++ b/input.c @@ -1531,8 +1531,11 @@ wl_pointer_leave(void *data, struct wl_pointer *wl_pointer, render_refresh_csd(old_moused); break; - case TERM_SURF_NONE: case TERM_SURF_GRID: + selection_finalize(seat, old_moused, seat->pointer.serial); + break; + + case TERM_SURF_NONE: case TERM_SURF_SEARCH: case TERM_SURF_SCROLLBACK_INDICATOR: case TERM_SURF_RENDER_TIMER: