backends: Dissociate visibility from current cursor sprite

Just like X11/XFixes behaves, the current cursor is not affected
by its visibility, so it can be queried while invisible (possibly
to be replaced).

For this, keep an extra effective_cursor pointer that will be
either equal to displayed_cursor (maybe a bit of a misnomer now)
or NULL if the cursor is invisible. The MetaCursorRenderer
management is tied to the former, and the ::cursor-changed signal
emission to the latter.

https://bugzilla.gnome.org/show_bug.cgi?id=754806
This commit is contained in:
Carlos Garnacho
2017-11-16 19:23:09 +01:00
parent 6c18bae83c
commit b1a0bf8916
2 changed files with 40 additions and 22 deletions

View File

@ -32,6 +32,7 @@ struct _MetaCursorTracker {
gboolean is_showing;
MetaCursorSprite *effective_cursor; /* May be NULL when hidden */
MetaCursorSprite *displayed_cursor;
/* Wayland clients can set a NULL buffer as their cursor