summaryrefslogtreecommitdiff
path: root/ui/sdl.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2014-03-11 12:52:08 +0000
committerPeter Maydell <peter.maydell@linaro.org>2014-03-11 12:52:08 +0000
commitc57ec3249e9839c7ea2e3789f6e40f9ec1c92f55 (patch)
tree012e65e0b2aefb31098924b6948cc3a057982715 /ui/sdl.c
parentfe6c53b4bbd2e83f82087bc5e37daa11ffc65879 (diff)
parentdbb2a1326a7af6159861d3d7976c251a15ce0f92 (diff)
downloadqemu-c57ec3249e9839c7ea2e3789f6e40f9ec1c92f55.tar.gz
Merge remote-tracking branch 'remotes/kraxel/tags/pull-input-5' into staging
input: fixes for the rewrite. # gpg: Signature made Mon 10 Mar 2014 12:50:25 GMT using RSA key ID D3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" * remotes/kraxel/tags/pull-input-5: input: map INPUT_BUTTON_WHEEL_{UP,DOWN} to legacy input z axis moves. input: sdl: fix guest_cursor logic. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'ui/sdl.c')
-rw-r--r--ui/sdl.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/ui/sdl.c b/ui/sdl.c
index c1a16bebdc..4e7f920e37 100644
--- a/ui/sdl.c
+++ b/ui/sdl.c
@@ -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();
}