mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-04-19 06:47:02 -04:00
backend/wayland: handle scale
This commit is contained in:
parent
ecc3892808
commit
e7ee2a2442
3 changed files with 36 additions and 10 deletions
|
|
@ -87,11 +87,12 @@ static void pointer_handle_motion(void *data, struct wl_pointer *wl_pointer,
|
|||
}
|
||||
|
||||
struct wlr_output *wlr_output = &pointer->output->wlr_output;
|
||||
int scale = ceil(wlr_output->scale);
|
||||
struct wlr_pointer_motion_absolute_event event = {
|
||||
.pointer = &pointer->wlr_pointer,
|
||||
.time_msec = time,
|
||||
.x = wl_fixed_to_double(sx) / wlr_output->width,
|
||||
.y = wl_fixed_to_double(sy) / wlr_output->height,
|
||||
.x = wl_fixed_to_double(sx) * scale / wlr_output->width,
|
||||
.y = wl_fixed_to_double(sy) * scale / wlr_output->height,
|
||||
};
|
||||
wl_signal_emit_mutable(&pointer->wlr_pointer.events.motion_absolute, &event);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue