wayland: Support scaling of theme based cursors

Support scaling of cursors created from themes. The default scale is
always 1, but if the pointer cursor surface enters an output with a
higher scale, load the larger version of the cursor theme and use the
image from that theme.

This assumes the theme size is set to one that fits with an output scale
= 1.

https://bugzilla.gnome.org/show_bug.cgi?id=746141
This commit is contained in:
Jonas Ådahl
2015-03-13 15:40:18 +08:00
parent 7b2cdabc2e
commit 465647e964
5 changed files with 213 additions and 20 deletions

View File

@ -42,6 +42,9 @@
G_BEGIN_DECLS
#define GDK_WAYLAND_MAX_THEME_SCALE 2
#define GDK_WAYLAND_THEME_SCALES_COUNT GDK_WAYLAND_MAX_THEME_SCALE
typedef struct _GdkWaylandSelection GdkWaylandSelection;
struct _GdkWaylandDisplay
@ -69,7 +72,9 @@ struct _GdkWaylandDisplay
struct wl_data_device_manager *data_device_manager;
struct wl_subcompositor *subcompositor;
struct wl_cursor_theme *cursor_theme;
struct wl_cursor_theme *scaled_cursor_themes[GDK_WAYLAND_THEME_SCALES_COUNT];
gchar *cursor_theme_name;
int cursor_theme_size;
GHashTable *cursor_cache;
GSource *event_source;