summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorJan Kiszka2012-01-31 13:45:30 +0100
committerAnthony Liguori2012-02-01 21:45:02 +0100
commit822f98d2a56c8dcc857bb6a4c4da6382787533a0 (patch)
tree7f3677d0c735028618301e5717fd843e6f22fcad /ui
parentRevert "Handle SDL grabs failing (Mark McLoughlin)" (diff)
downloadqemu-822f98d2a56c8dcc857bb6a4c4da6382787533a0.tar.gz
qemu-822f98d2a56c8dcc857bb6a4c4da6382787533a0.tar.xz
qemu-822f98d2a56c8dcc857bb6a4c4da6382787533a0.zip
sdl: Grab input on end of non-absolute mouse click
By grabbing the input already on button down, we leave the button in that state for the host GUI. Thus it takes another click after releasing the input again to synchronize the mouse button state. Avoid this by grabbing on button up. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'ui')
-rw-r--r--ui/sdl.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/ui/sdl.c b/ui/sdl.c
index 0d3a889741..73e58395eb 100644
--- a/ui/sdl.c
+++ b/ui/sdl.c
@@ -802,8 +802,7 @@ static void handle_mousebutton(DisplayState *ds, SDL_Event *ev)
bev = &ev->button;
if (!gui_grab && !kbd_mouse_is_absolute()) {
- if (ev->type == SDL_MOUSEBUTTONDOWN &&
- (bev->button == SDL_BUTTON_LEFT)) {
+ if (ev->type == SDL_MOUSEBUTTONUP && bev->button == SDL_BUTTON_LEFT) {
/* start grabbing all events */
sdl_grab_start();
}