aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-02-15 18:02:43 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-02-15 18:02:43 +0000
commite5253ca7375fc59c07b3c7d1356ecff7fadf12b0 (patch)
tree4ba1c5051cadb5619374e4b015e838fe0bbdabdf
parentMerge branch 'configurable-padding' (diff)
input: fix xcursor getting stuck
Apparently, a frame callback for the cursor surface is *never* triggered if we get a pointer-leave event *before* the callback is triggered. At least on Sway 1.4. This caused the cursor being stuck, and never updating once this state was reached. Fix by destroying the cursor frame callback on pointer-leave.
-rw-r--r--input.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/input.c b/input.c
index 77355918..c8f920b3 100644
--- a/input.c
+++ b/input.c
@@ -641,6 +641,14 @@ wl_pointer_leave(void *data, struct wl_pointer *wl_pointer,
LOG_DBG("pointer-leave: surface = %p, old-moused = %p", surface, old_moused);
+ if (wayl->pointer.xcursor_callback != NULL) {
+ /* A cursor frame callback may never be called if the pointer leaves our surface */
+ wl_callback_destroy(wayl->pointer.xcursor_callback);
+ wayl->pointer.xcursor_callback = NULL;
+ wayl->pointer.pending_terminal = NULL;
+ wayl->pointer.xcursor = NULL;
+ }
+
wayl->mouse_focus = NULL;
if (old_moused == NULL) {
LOG_WARN(