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:
Daniel Eklöf 2020-02-15 19:02:43 +01:00
parent 26a8d4b8a1
commit e5253ca737
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -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(