cursor-shape: add support for server side cursor shapes

This implements support for the new cursor-shape-v1 protocol. When
available, we use it, instead of client-side cursor surfaces, to
select the xcursor shape.

Note that we still need to keep client side pointers, for:

* backward compatibility
* to be able to "hide" the cursor

Closes #1379
This commit is contained in:
Daniel Eklöf 2023-06-27 17:25:57 +02:00
parent ee794a121e
commit c8e13ad393
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
8 changed files with 280 additions and 20 deletions

View file

@ -146,12 +146,18 @@ struct seat {
struct {
uint32_t serial;
/* Client-side cursor */
struct wayl_surface surface;
struct wl_cursor_theme *theme;
struct wl_cursor *cursor;
/* Server-side cursor */
#if defined(HAVE_CURSOR_SHAPE)
struct wp_cursor_shape_device_v1 *shape_device;
#endif
float scale;
bool hidden;
enum cursor_shape shape;
struct wl_callback *xcursor_callback;
bool xcursor_pending;
@ -426,6 +432,10 @@ struct wayland {
struct xdg_activation_v1 *xdg_activation;
#endif
#if defined(HAVE_CURSOR_SHAPE)
struct wp_cursor_shape_manager_v1 *cursor_shape_manager;
#endif
bool presentation_timings;
struct wp_presentation *presentation;
uint32_t presentation_clock_id;