Hacker News new | ask | show | jobs
by Jasper_ 825 days ago
No, it's not the client's job to draw the cursor. The client provides a surface, the same kind of thing as any other window, and asks for it to become the cursor. The client draws into the surface, but the placement and drawing of this surface to the screen is done by the compositor (most likely with an overlay plane).

This allows the application to customize the cursor, which happens more frequently than you might expect, e.g. dragging and dropping a file changes the "cursor" to include the little preview of the file. So the client already needs to learn how to render cursor images to composite the cursor image on top of the DnD preview.

One of Wayland's original core philosophies is to share behavior by shared library, rather than by protocol, because social agreement is already required, and is way better for a community long-term. So there is also a libwayland-cursor library that allows you to load Xcursors, which allows the client to do all the compositing and customization it needs, while still supporting a standard.

zwp_cursor_shape makes sense for a basic client without too many needs, but it's not a great idea for a full toolkit, otherwise DnD dragging (or any other case that requires compositing cursor images) will show a different cursor.

Also, SVG for cursors is not really a great idea.