diff options
author | Simon Ser <contact@emersion.fr> | 2023-06-05 15:31:57 +0200 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2023-06-15 18:28:43 +0200 |
commit | da04b066ea037be0fdc5d79ac6b214fea6f2d3c5 (patch) | |
tree | 1480693c9f8224b8c3b38abd61dfd4da102b882c /tinywl | |
parent | 58a2f8bd5cbff646905752f5ecc0fa92533496fc (diff) |
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
Diffstat (limited to 'tinywl')
-rw-r--r-- | tinywl/tinywl.c | 6 |
1 files changed, 2 insertions, 4 deletions
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 |