From 5fb09915c5d7f15621856f755ce42a8cef08c110 Mon Sep 17 00:00:00 2001 From: Manuel Barrio Linares Date: Thu, 8 Jan 2026 15:15:22 -0300 Subject: [PATCH] wlroots: changes in wlr_xwayland_set_cursor Signed-off-by: Manuel Barrio Linares --- src/xwayland.c | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/src/xwayland.c b/src/xwayland.c index 5984a31b..6efa3cd6 100644 --- a/src/xwayland.c +++ b/src/xwayland.c @@ -1200,10 +1200,9 @@ xwayland_server_init(struct server *server, struct wlr_compositor *compositor) server->seat.xcursor_manager, XCURSOR_DEFAULT, 1); if (xcursor) { struct wlr_xcursor_image *image = xcursor->images[0]; - wlr_xwayland_set_cursor(server->xwayland, image->buffer, - image->width * 4, image->width, - image->height, image->hotspot_x, - image->hotspot_y); + struct wlr_buffer *cursor_buffer = wlr_xcursor_image_get_buffer(image); + wlr_xwayland_set_cursor(server->xwayland, cursor_buffer, + image->hotspot_x, image->hotspot_y); } } @@ -1238,23 +1237,11 @@ xwayland_reset_cursor(struct server *server) if (xcursor && !server->xwayland->xwm) { /* Prevents setting the cursor on an active xwayland server */ struct wlr_xcursor_image *image = xcursor->images[0]; - wlr_xwayland_set_cursor(server->xwayland, image->buffer, - image->width * 4, image->width, - image->height, image->hotspot_x, - image->hotspot_y); + struct wlr_buffer *cursor_buffer = wlr_xcursor_image_get_buffer(image); + wlr_xwayland_set_cursor(server->xwayland, cursor_buffer, + image->hotspot_x, image->hotspot_y); return; } - - if (server->xwayland->cursor) { - /* - * The previous configured theme has set the - * default cursor or the xwayland server is - * currently running but still has a cached - * xcursor set that will be used on the next - * xwayland destroy -> lazy startup cycle. - */ - zfree(server->xwayland->cursor); - } } void