summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Fourdan <ofourdan@redhat.com>2021-10-19 17:59:01 +0200
committerOlivier Fourdan <ofourdan@redhat.com>2021-10-20 14:04:16 +0200
commitb7b2c34068f5541680315dcb7741a215a36dfd9f (patch)
treeb74b60fb36e78c1385da1c92612d2f2140080bad
parent21e3dc3b5a576d38b549716bda0a6b34612e1f1f (diff)
xwayland: Clear tablet cursor pending frame cb
If the tablet tool is moved out of proximity before the cursor's pending frame callback is received, any further attempts to update the cursor will fail because the frame callback is still pending. Make sure to clear any cursor pending frame when the tool gets in proximity again, similar to what we do when the pointer re-enters a surface, so that the cursor updates aren't discarded. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> See-also: https://gitlab.gnome.org/GNOME/mutter/-/issues/1969 Reviewed-by: Carlos Garnacho <carlosg@gnome.org> (cherry picked from commit 35c5664fd40b0614cd7c43679809c42e1918cda2)
-rw-r--r--hw/xwayland/xwayland-input.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c
index 26b3630c7..1edfd0b10 100644
--- a/hw/xwayland/xwayland-input.c
+++ b/hw/xwayland/xwayland-input.c
@@ -1677,6 +1677,13 @@ tablet_tool_proximity_in(void *data, struct zwp_tablet_tool_v2 *tool,
xwl_tablet_tool->proximity_in_serial = serial;
xwl_seat->tablet_focus_window = wl_surface_get_user_data(wl_surface);
+ /* If there is a cursor surface frame callback pending, we need to clear it
+ * so that we can continue submitting new cursor frames.
+ */
+ if (xwl_tablet_tool->cursor.frame_cb) {
+ wl_callback_destroy(xwl_tablet_tool->cursor.frame_cb);
+ xwl_tablet_tool->cursor.frame_cb = NULL;
+ }
xwl_tablet_tool_set_cursor(xwl_tablet_tool);
}