aboutsummaryrefslogtreecommitdiffhomepage
path: root/video/out
diff options
context:
space:
mode:
authorGravatar Rostislav Pehlivanov <atomnuker@gmail.com>2017-10-10 02:38:18 +0100
committerGravatar Rostislav Pehlivanov <atomnuker@gmail.com>2017-10-10 02:39:39 +0100
commit7c66c2bb75bb9f252dc976ab1805fecc610438e7 (patch)
tree5b7b7ec6967319248232f13bfc9f286779ef9903 /video/out
parent1abac5f4aa06bd5a130d2e2ab1ffc8abbc63644d (diff)
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.
Diffstat (limited to 'video/out')
-rw-r--r--video/out/wayland_common.c5
1 files changed, 3 insertions, 2 deletions
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;