[PATCH] xwayland: Clear pending cursor frame callbacks on pointer enter

Rui Matos tiagomatos at gmail.com
Thu Feb 4 17:52:32 CET 2016


The last cursor frame we commited before the pointer left one of our
surfaces might not have been shown. In that case we'll have a cursor
surface frame callback pending which we need to clear so that we can
continue submitting new cursor frames.

Signed-off-by: Rui Matos <tiagomatos at gmail.com>
Reviewed-by: Daniel Stone <daniels at collabora.com>
---

v2: as suggested by Jonas, moved the hunk further up to stay close to
    another related hack we already have and also removed the
    xwl_seat_set_cursor() call since CheckMotion() will do that too.

    I think Daniel's r-b still stands anyway.

 hw/xwayland/xwayland-input.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c
index 61ca70b..d6cbf32 100644
--- a/hw/xwayland/xwayland-input.c
+++ b/hw/xwayland/xwayland-input.c
@@ -251,6 +251,15 @@ pointer_handle_enter(void *data, struct wl_pointer *pointer,
     mipointer = MIPOINTER(master);
     mipointer->pSpriteCursor = (CursorPtr) 1;
 
+    /* The last cursor frame we commited before the pointer left one
+     * of our surfaces might not have been shown. In that case we'll
+     * have a cursor surface frame callback pending which we need to
+     * clear so that we can continue submitting new cursor frames. */
+    if (xwl_seat->cursor_frame_cb) {
+        wl_callback_destroy(xwl_seat->cursor_frame_cb);
+        xwl_seat->cursor_frame_cb = NULL;
+    }
+
     CheckMotion(NULL, master);
 
     /* Ideally, X clients shouldn't see these button releases.  When
-- 
2.5.0



More information about the xorg-devel mailing list