mirror of
https://codeberg.org/dnkl/yambar.git
synced 2025-04-22 20:25:39 +02:00
bar/wayland: scale mouse cursor's hotspot coordinate
This commit is contained in:
parent
d172cc1cd5
commit
3adbf70a49
1 changed files with 4 additions and 3 deletions
|
@ -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(
|
||||
|
|
Loading…
Add table
Reference in a new issue