Commit c3aa84b6 authored by Gerd Hoffmann's avatar Gerd Hoffmann

input: sdl: fix guest_cursor logic.

Unbreaks relative mouse mode with SDL.
Reported-by: default avatarGabriel L. Somlo <gsomlo@gmail.com>
Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
parent f53f3d0a
......@@ -455,13 +455,17 @@ static void sdl_send_mouse_event(int dx, int dy, int x, int y, int state)
real_screen->w);
qemu_input_queue_abs(dcl->con, INPUT_AXIS_Y, y,
real_screen->h);
} else if (guest_cursor) {
x -= guest_x;
y -= guest_y;
guest_x += x;
guest_y += y;
qemu_input_queue_rel(dcl->con, INPUT_AXIS_X, x);
qemu_input_queue_rel(dcl->con, INPUT_AXIS_Y, y);
} else {
if (guest_cursor) {
x -= guest_x;
y -= guest_y;
guest_x += x;
guest_y += y;
dx = x;
dy = y;
}
qemu_input_queue_rel(dcl->con, INPUT_AXIS_X, dx);
qemu_input_queue_rel(dcl->con, INPUT_AXIS_Y, dy);
}
qemu_input_event_sync();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment