From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O9W31-0001rh-Fc for qemu-devel@nongnu.org; Wed, 05 May 2010 00:17:23 -0400 Received: from [140.186.70.92] (port=56048 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O9W2z-0001oW-HA for qemu-devel@nongnu.org; Wed, 05 May 2010 00:17:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O9W2x-0006bW-5N for qemu-devel@nongnu.org; Wed, 05 May 2010 00:17:21 -0400 Received: from hrndva-omtalb.mail.rr.com ([71.74.56.125]:37313) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O9W2x-0006bM-2J for qemu-devel@nongnu.org; Wed, 05 May 2010 00:17:19 -0400 Received: from ataxia.xo ([10.230.45.5] helo=ataxia) by anomie.yi.org with esmtp (Exim 4.71) (envelope-from ) id 1O9W2w-0003TV-4d for qemu-devel@nongnu.org; Wed, 05 May 2010 00:17:18 -0400 Received: from brad by ataxia with local (Exim 4.71) (envelope-from ) id 1O9W2r-0004Jw-4E for qemu-devel@nongnu.org; Wed, 05 May 2010 00:17:13 -0400 From: Brad Jorsch Date: Wed, 5 May 2010 00:17:08 -0400 Message-Id: <1273033029-15622-2-git-send-email-anomie@users.sourceforge.net> In-Reply-To: <1273033029-15622-1-git-send-email-anomie@users.sourceforge.net> References: <1273033029-15622-1-git-send-email-anomie@users.sourceforge.net> Subject: [Qemu-devel] [PATCH 1/2] Fix clearing modifiers on focus loss List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org It seems there is an intention to clear all modifier keys (in the SDL front-end) when the window loses focus, but it seems that it doesn't work right. Let's just explicitly do it when we lose input focus. Signed-off-by: Brad Jorsch --- sdl.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/sdl.c b/sdl.c index f6fabf1..c155113 100644 --- a/sdl.c +++ b/sdl.c @@ -728,6 +728,9 @@ static void sdl_refresh(DisplayState *ds) } break; case SDL_ACTIVEEVENT: + if (ev->active.state == SDL_APPINPUTFOCUS && !ev->active.gain) { + reset_keys(); + } if (gui_grab && ev->active.state == SDL_APPINPUTFOCUS && !ev->active.gain && !gui_fullscreen_initial_grab) { sdl_grab_end(); -- 1.7.1