From 7c66c2bb75bb9f252dc976ab1805fecc610438e7 Mon Sep 17 00:00:00 2001 From: Rostislav Pehlivanov Date: Tue, 10 Oct 2017 02:38:18 +0100 Subject: wayland_common: adjust default cursor size and scale its buffer It turns out compositors which do scaling scale the cursor as well, so every single surface needs to get scaled too. Also, 32 corresponds to the default size for both GTK+ and KDE. --- video/out/wayland_common.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'video') diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c index 6f554c107d..4daf4570f6 100644 --- a/video/out/wayland_common.c +++ b/video/out/wayland_common.c @@ -49,13 +49,14 @@ static int set_cursor_visibility(struct vo_wayland_state *wl, int on) if (!wl->pointer) return VO_NOTAVAIL; if (on) { - struct wl_cursor_image *image = wl->default_cursor->images[0]; + struct wl_cursor_image *image = wl->default_cursor->images[0]; struct wl_buffer *buffer = wl_cursor_image_get_buffer(image); if (!buffer) return VO_FALSE; wl_pointer_set_cursor(wl->pointer, wl->pointer_id, wl->cursor_surface, image->hotspot_x, image->hotspot_y); wl_surface_attach(wl->cursor_surface, buffer, 0, 0); + wl_surface_set_buffer_scale(wl->cursor_surface, wl->scaling); wl_surface_damage(wl->cursor_surface, 0, 0, image->width, image->height); wl_surface_commit(wl->cursor_surface); } else { @@ -834,7 +835,7 @@ static const struct wl_registry_listener registry_listener = { static int spawn_cursor(struct vo_wayland_state *wl) { - wl->cursor_theme = wl_cursor_theme_load(NULL, 24, wl->shm); + wl->cursor_theme = wl_cursor_theme_load(NULL, 32, wl->shm); if (!wl->cursor_theme) { MP_ERR(wl, "Unable to load cursor theme!\n"); return 1; -- cgit v1.2.3