From: Alexandros Frantzis alexandros.frantzis@collabora.com
SDL 2.0.18 and newer (including SDL 3) set a fully transparent cursor object when hiding the cursor (instead of using a NULL cursor handle). Detect this case and treat it as a request to hide the cursor, to make our locking/relative-motion heuristics work. --- dlls/winewayland.drv/wayland_pointer.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
diff --git a/dlls/winewayland.drv/wayland_pointer.c b/dlls/winewayland.drv/wayland_pointer.c index e2b31e02011..17139c47b13 100644 --- a/dlls/winewayland.drv/wayland_pointer.c +++ b/dlls/winewayland.drv/wayland_pointer.c @@ -494,6 +494,17 @@ static BOOL get_icon_info(HICON handle, ICONINFOEXW *ret) return TRUE; }
+static BOOL cursor_buffer_is_transparent(struct wayland_shm_buffer *shm_buffer) +{ + uint32_t *pixel = shm_buffer->map_data; + uint32_t *end = pixel + shm_buffer->map_size / WINEWAYLAND_BYTES_PER_PIXEL; + + for (; pixel < end; ++pixel) + if ((*pixel & 0xff000000) != 0) return FALSE; + + return TRUE; +} + static void wayland_pointer_update_cursor_buffer(HCURSOR hcursor, double scale) { struct wayland_cursor *cursor = &process_wayland.pointer.cursor; @@ -538,6 +549,9 @@ static void wayland_pointer_update_cursor_buffer(HCURSOR hcursor, double scale) goto clear_cursor; }
+ if (cursor_buffer_is_transparent(cursor->shm_buffer)) + goto clear_cursor; + /* Make sure the hotspot is valid. */ if (cursor->hotspot_x >= cursor->shm_buffer->width || cursor->hotspot_y >= cursor->shm_buffer->height)