mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-29 16:05:59 +01:00
Use attach x,y when computing hotspot, set sx,sy in surface_attach
This commit is contained in:
parent
008e1d596d
commit
c4c948c5d9
2 changed files with 4 additions and 1 deletions
|
@ -193,7 +193,8 @@ static void handle_cursor_surface_commit(struct wl_listener *listener,
|
|||
int32_t stride = wl_shm_buffer_get_stride(buffer);
|
||||
wl_shm_buffer_begin_access(buffer);
|
||||
wlr_output_set_cursor(output, buffer_data, stride/4, width, height,
|
||||
output->cursor.hotspot_x, output->cursor.hotspot_y);
|
||||
output->cursor.hotspot_x - surface->current->sx,
|
||||
output->cursor.hotspot_y - surface->current->sy);
|
||||
wl_shm_buffer_end_access(buffer);
|
||||
}
|
||||
|
||||
|
|
|
@ -51,6 +51,8 @@ static void surface_attach(struct wl_client *client,
|
|||
struct wlr_surface *surface = wl_resource_get_user_data(resource);
|
||||
|
||||
surface->pending->invalid |= WLR_SURFACE_INVALID_BUFFER;
|
||||
surface->pending->sx = sx;
|
||||
surface->pending->sy = sy;
|
||||
wlr_surface_state_reset_buffer(surface->pending);
|
||||
wlr_surface_state_set_buffer(surface->pending, buffer);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue