From 3adbf70a493b636a58745e7022747765fb7a8f76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Wed, 15 May 2019 19:04:10 +0200 Subject: [PATCH] bar/wayland: scale mouse cursor's hotspot coordinate --- bar/wayland.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bar/wayland.c b/bar/wayland.c index d09fe62..151dc66 100644 --- a/bar/wayland.c +++ b/bar/wayland.c @@ -121,17 +121,18 @@ update_cursor_surface(struct wayland_backend *backend) if (backend->pointer.cursor == NULL) return; + const int scale = backend->monitor->scale; + struct wl_cursor_image *image = backend->pointer.cursor->images[0]; - wl_surface_set_buffer_scale( - backend->pointer.surface, backend->monitor->scale); + wl_surface_set_buffer_scale(backend->pointer.surface, scale); wl_surface_attach( backend->pointer.surface, wl_cursor_image_get_buffer(image), 0, 0); wl_pointer_set_cursor( backend->pointer.pointer, backend->pointer.serial, - backend->pointer.surface, image->hotspot_x, image->hotspot_y); + backend->pointer.surface, image->hotspot_x / scale, image->hotspot_y / scale); wl_surface_damage_buffer(