mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-26 14:45:58 +01:00
backend/wayland: manage cursor for current pointer
This commit is contained in:
parent
b98522b38f
commit
df417b7e95
2 changed files with 4 additions and 2 deletions
|
@ -419,8 +419,9 @@ static void output_destroy(struct wlr_output *wlr_output) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void update_wl_output_cursor(struct wlr_wl_output *output) {
|
void update_wl_output_cursor(struct wlr_wl_output *output) {
|
||||||
if (output->backend->pointer && output->enter_serial) {
|
struct wlr_wl_pointer *pointer = output->backend->current_pointer;
|
||||||
wl_pointer_set_cursor(output->backend->pointer, output->enter_serial,
|
if (pointer && pointer->output == output && output->enter_serial) {
|
||||||
|
wl_pointer_set_cursor(pointer->wl_pointer, output->enter_serial,
|
||||||
output->cursor.surface, output->cursor.hotspot_x,
|
output->cursor.surface, output->cursor.hotspot_x,
|
||||||
output->cursor.hotspot_y);
|
output->cursor.hotspot_y);
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,6 +48,7 @@ static void pointer_handle_enter(void *data, struct wl_pointer *wl_pointer,
|
||||||
struct wlr_wl_output *output = wl_surface_get_user_data(surface);
|
struct wlr_wl_output *output = wl_surface_get_user_data(surface);
|
||||||
assert(output);
|
assert(output);
|
||||||
struct wlr_wl_pointer *pointer = output_get_pointer(output);
|
struct wlr_wl_pointer *pointer = output_get_pointer(output);
|
||||||
|
assert(!backend->current_pointer || backend->current_pointer == pointer);
|
||||||
|
|
||||||
output->enter_serial = serial;
|
output->enter_serial = serial;
|
||||||
backend->current_pointer = pointer;
|
backend->current_pointer = pointer;
|
||||||
|
|
Loading…
Reference in a new issue