From patchwork Sat Jul 30 09:39:06 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 107490 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 32618B6EE8 for ; Sat, 30 Jul 2011 19:49:02 +1000 (EST) Received: from localhost ([::1]:44708 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qn61Z-0007Zd-E2 for incoming@patchwork.ozlabs.org; Sat, 30 Jul 2011 05:40:01 -0400 Received: from eggs.gnu.org ([140.186.70.92]:58369) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qn614-00065J-KH for qemu-devel@nongnu.org; Sat, 30 Jul 2011 05:39:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qn60z-0005ba-7t for qemu-devel@nongnu.org; Sat, 30 Jul 2011 05:39:30 -0400 Received: from fmmailgate01.web.de ([217.72.192.221]:58702) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qn60z-0005ax-15 for qemu-devel@nongnu.org; Sat, 30 Jul 2011 05:39:25 -0400 Received: from smtp03.web.de ( [172.20.0.65]) by fmmailgate01.web.de (Postfix) with ESMTP id 17C5719476DAF; Sat, 30 Jul 2011 11:39:24 +0200 (CEST) Received: from [92.75.128.27] (helo=localhost.localdomain) by smtp03.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.110 #2) id 1Qn60y-0001Sl-00; Sat, 30 Jul 2011 11:39:24 +0200 From: Jan Kiszka To: Anthony Liguori , qemu-devel Date: Sat, 30 Jul 2011 11:39:06 +0200 Message-Id: X-Mailer: git-send-email 1.7.3.4 In-Reply-To: References: In-Reply-To: References: X-Sender: jan.kiszka@web.de X-Provags-ID: V01U2FsdGVkX183W140xgscw+7ICjM11sQxaWCsKrNS+3fTxOVb k1Ex9ECaY7ADuCKDK/D55iyN8Ycrrak7EbRzLxppI/FT+CQucs SW5ltCalo= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-Received-From: 217.72.192.221 Subject: [Qemu-devel] [PATCH 03/15] sdl: Avoid redundant scaling deactivation X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Jan Kiszka Prevents screen flickering. Signed-off-by: Jan Kiszka --- ui/sdl.c | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ui/sdl.c b/ui/sdl.c index 9a92b47..1563ee1 100644 --- a/ui/sdl.c +++ b/ui/sdl.c @@ -583,10 +583,12 @@ static void sdl_refresh(DisplayState *ds) gui_keysym = 1; break; case 0x16: /* 'u' key on US keyboard */ - scaling_active = 0; - sdl_resize(ds); - vga_hw_invalidate(); - vga_hw_update(); + if (scaling_active) { + scaling_active = 0; + sdl_resize(ds); + vga_hw_invalidate(); + vga_hw_update(); + } break; case 0x02 ... 0x0a: /* '1' to '9' keys */ /* Reset the modifiers sent to the current console */