Skip to content

Commit

Permalink
[Wayland] Move delta increments to handle_relative_motion.
Browse files Browse the repository at this point in the history
  • Loading branch information
vanfanel committed Mar 19, 2023
1 parent 74913ea commit f29a351
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 9 additions & 3 deletions input/common/wayland_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -427,10 +427,16 @@ static void handle_relative_motion(void *data,
wl_fixed_t dx, wl_fixed_t dy,
wl_fixed_t dx_unaccel, wl_fixed_t dy_unaccel)
{
gfx_ctx_wayland_data_t *wl = (gfx_ctx_wayland_data_t*)data;
gfx_ctx_wayland_data_t *wl = (gfx_ctx_wayland_data_t*)data;

wl->input.mouse.delta_x = wl_fixed_to_int(dx);
wl->input.mouse.delta_y = wl_fixed_to_int(dy);

wl->input.mouse.delta_x = wl_fixed_to_int(dx);
wl->input.mouse.delta_y = wl_fixed_to_int(dy);
if (wl->locked_pointer)
{
wl->input.mouse.x += wl->input.mouse.delta_x;
wl->input.mouse.y += wl->input.mouse.delta_y;
}
}

static void
Expand Down
6 changes: 0 additions & 6 deletions input/drivers/wayland_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,6 @@ static void input_wl_poll(void *data)
wl->mouse.last_x = wl->mouse.x;
wl->mouse.last_y = wl->mouse.y;

if (wl->gfx->locked_pointer)
{
wl->mouse.x += wl->mouse.delta_x;
wl->mouse.y += wl->mouse.delta_y;
}

if (!wl->mouse.focus)
{
wl->mouse.delta_x = 0;
Expand Down

0 comments on commit f29a351

Please sign in to comment.