From da04b066ea037be0fdc5d79ac6b214fea6f2d3c5 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Mon, 5 Jun 2023 15:31:57 +0200 Subject: cursor: add wlr_cursor_set_xcursor() This keeps track of the last set XCursor. If it hasn't changed, skip the texture upload. In the future, support for animated XCursors can be added. Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3436 --- tinywl/tinywl.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'tinywl') diff --git a/tinywl/tinywl.c b/tinywl/tinywl.c index bfabac6e..e6e3ceee 100644 --- a/tinywl/tinywl.c +++ b/tinywl/tinywl.c @@ -449,8 +449,7 @@ static void process_cursor_motion(struct tinywl_server *server, uint32_t time) { /* If there's no view under the cursor, set the cursor image to a * default. This is what makes the cursor image appear when you move it * around the screen, not over any views. */ - wlr_xcursor_manager_set_cursor_image( - server->cursor_mgr, "default", server->cursor); + wlr_cursor_set_xcursor(server->cursor, server->cursor_mgr, "default"); } if (surface) { /* @@ -927,9 +926,8 @@ int main(int argc, char *argv[]) { /* Creates an xcursor manager, another wlroots utility which loads up * Xcursor themes to source cursor images from and makes sure that cursor * images are available at all scale factors on the screen (necessary for - * HiDPI support). We add a cursor theme at scale factor 1 to begin with. */ + * HiDPI support). */ server.cursor_mgr = wlr_xcursor_manager_create(NULL, 24); - wlr_xcursor_manager_load(server.cursor_mgr, 1); /* * wlr_cursor *only* displays an image on screen. It does not move around -- cgit v1.2.3