diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2023-07-17 18:08:34 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2023-07-18 03:44:17 +0000 |
| commit | 6de69aa9b726c2e270455ac44a7b8d5177b7332e (patch) | |
| tree | 2e8b245d83ca71b9001d2cbe7f50bd4598c06ef6 /render.c | |
| parent | input: do not ignore touch events on the CSDs (diff) | |
render: fix xcursor scaling with fractional-scale-v1
This worked just after the fractional-scaling branch was merged, but
was then broken by the cursor-shape branch, due to a bad rebase of
that branch.
Diffstat (limited to 'render.c')
| -rw-r--r-- | render.c | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -4297,11 +4297,15 @@ render_xcursor_update(struct seat *seat) LOG_DBG("setting %scursor shape using a client-side cursor surface", shape == CURSOR_SHAPE_CUSTOM ? "custom " : ""); - const int scale = seat->pointer.scale; + const float scale = seat->pointer.scale; struct wl_cursor_image *image = seat->pointer.cursor->images[0]; + struct wl_buffer *buf = wl_cursor_image_get_buffer(image); - wl_surface_attach( - seat->pointer.surface.surf, wl_cursor_image_get_buffer(image), 0, 0); + wayl_surface_scale_explicit_width_height( + seat->mouse_focus->window, + &seat->pointer.surface, image->width, image->height, scale); + + wl_surface_attach(seat->pointer.surface.surf, buf, 0, 0); wl_pointer_set_cursor( seat->wl_pointer, seat->pointer.serial, @@ -4311,8 +4315,6 @@ render_xcursor_update(struct seat *seat) wl_surface_damage_buffer( seat->pointer.surface.surf, 0, 0, INT32_MAX, INT32_MAX); - wl_surface_set_buffer_scale(seat->pointer.surface.surf, scale); - xassert(seat->pointer.xcursor_callback == NULL); seat->pointer.xcursor_callback = wl_surface_frame(seat->pointer.surface.surf); wl_callback_add_listener(seat->pointer.xcursor_callback, &xcursor_listener, seat); |
