From patchwork Wed May 5 04:17:08 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brad Jorsch X-Patchwork-Id: 51705 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id E60E8B7D40 for ; Thu, 6 May 2010 02:04:18 +1000 (EST) Received: from localhost ([127.0.0.1]:54879 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O9gzL-0000NE-4G for incoming@patchwork.ozlabs.org; Wed, 05 May 2010 11:58:19 -0400 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 X-Authority-Analysis: v=1.1 cv=Sj+DEJq9TvmrEz0yYf786F+83+V8ZKDvY/KsKt+Cs/8= c=1 sm=0 a=_5NmhzT1-dcA:10 a=KM8nfJeeGFAA:10 a=sFBlSW20FPk1v4aQxZ+5uA==:17 a=FP58Ms26AAAA:8 a=1wyFHHMfdGUPvFUx6SwA:9 a=4szugLh1Zb3dHW1devpsF9ouV30A:4 a=RCaI0d0hnL3NXDTv:21 a=oRnqkICHmnQXBPmq:21 a=sFBlSW20FPk1v4aQxZ+5uA==:117 X-Cloudmark-Score: 0 X-Originating-IP: 66.26.236.130 Received: from [66.26.236.130] ([66.26.236.130:46103] helo=anomie.yi.org) by hrndva-oedge01.mail.rr.com (envelope-from ) (ecelerity 2.2.2.39 r()) with ESMTP id 80/EE-01293-E41F0EB4; Wed, 05 May 2010 04:17:18 +0000 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 To: qemu-devel@nongnu.org Date: Wed, 5 May 2010 00:17:08 -0400 Message-Id: <1273033029-15622-2-git-send-email-anomie@users.sourceforge.net> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1273033029-15622-1-git-send-email-anomie@users.sourceforge.net> References: <1273033029-15622-1-git-send-email-anomie@users.sourceforge.net> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Subject: [Qemu-devel] [PATCH 1/2] Fix clearing modifiers on focus loss X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@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();