From: Jan Kiszka Date: Tue, 31 Jan 2012 12:45:30 +0000 (+0100) Subject: sdl: Grab input on end of non-absolute mouse click X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=822f98d2a56c8dcc857bb6a4c4da6382787533a0;p=qemu-xen-4.4-testing.git 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 Signed-off-by: Anthony Liguori --- diff --git a/ui/sdl.c b/ui/sdl.c index 0d3a88974..73e58395e 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(); }