mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-04 04:06:06 -05:00
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.
This commit is contained in:
parent
26a8d4b8a1
commit
e5253ca737
1 changed files with 8 additions and 0 deletions
8
input.c
8
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(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue