summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorCole Robinson <crobinso@redhat.com>2014-04-01 16:37:10 -0400
committerGerd Hoffmann <kraxel@redhat.com>2014-04-11 12:19:16 +0200
commitafbc0dd649809b34583c52f2bc99b5c82c06fd53 (patch)
treee475da19d9d5941ef52fd99a5dcfacfc3fdd523d /ui
parentf516a5cc051db6e999e9e60dc968dcb5aeffe11f (diff)
downloadhqemu-afbc0dd649809b34583c52f2bc99b5c82c06fd53.zip
hqemu-afbc0dd649809b34583c52f2bc99b5c82c06fd53.tar.gz
input: sdl2: Fix guest_cursor logic
Unbreaks relative mouse mode with sdl2, just like was done with sdl.c in c3aa84b6. Signed-off-by: Cole Robinson <crobinso@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'ui')
-rw-r--r--ui/sdl2.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/ui/sdl2.c b/ui/sdl2.c
index f1532e9..e4cb9fb 100644
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -403,13 +403,17 @@ static void sdl_send_mouse_event(struct sdl2_state *scon, int dx, int dy,
}
qemu_input_queue_abs(scon->dcl.con, INPUT_AXIS_X, off_x + x, max_w);
qemu_input_queue_abs(scon->dcl.con, INPUT_AXIS_Y, off_y + y, max_h);
- } else if (guest_cursor) {
- x -= guest_x;
- y -= guest_y;
- guest_x += x;
- guest_y += y;
- qemu_input_queue_rel(scon->dcl.con, INPUT_AXIS_X, x);
- qemu_input_queue_rel(scon->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(scon->dcl.con, INPUT_AXIS_X, dx);
+ qemu_input_queue_rel(scon->dcl.con, INPUT_AXIS_Y, dy);
}
qemu_input_event_sync();
}
OpenPOWER on IntegriCloud