From patchwork Sat Jul 30 09:39:16 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 107498 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 305C6B6F18 for ; Sat, 30 Jul 2011 20:42:27 +1000 (EST) Received: from localhost ([::1]:46291 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qn61x-0008Rv-1o for incoming@patchwork.ozlabs.org; Sat, 30 Jul 2011 05:40:25 -0400 Received: from eggs.gnu.org ([140.186.70.92]:58371) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qn614-00065h-LE for qemu-devel@nongnu.org; Sat, 30 Jul 2011 05:39:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qn611-0005dT-SX for qemu-devel@nongnu.org; Sat, 30 Jul 2011 05:39:30 -0400 Received: from fmmailgate02.web.de ([217.72.192.227]:35908) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qn611-0005cm-2u for qemu-devel@nongnu.org; Sat, 30 Jul 2011 05:39:27 -0400 Received: from smtp03.web.de ( [172.20.0.65]) by fmmailgate02.web.de (Postfix) with ESMTP id 20FAE1A7556DE; Sat, 30 Jul 2011 11:39:26 +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 1Qn610-0001Sl-00; Sat, 30 Jul 2011 11:39:26 +0200 From: Jan Kiszka To: Anthony Liguori , qemu-devel Date: Sat, 30 Jul 2011 11:39:16 +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: V01U2FsdGVkX19Fur2NK3rZpiwd58eikTThZbFNjDY7UFbcUFtL MLhkqMHFrk1t2hu4rZkuin+odqBu/yD0zb5Udt3oMLOoZrij8A BaT80jHcg= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-Received-From: 217.72.192.227 Cc: Stefano Stabellini Subject: [Qemu-devel] [PATCH 13/15] sdl: Add zoom hot keys 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 Allow to enlarge or shrink the screen via CTRL-ALT-+/-. In contrast to scaling the window, these controls always preserve the aspect ratio of the current console. CC: Stefano Stabellini Signed-off-by: Jan Kiszka --- qemu-doc.texi | 8 ++++++++ ui/sdl.c | 13 +++++++++++++ 2 files changed, 21 insertions(+), 0 deletions(-) diff --git a/qemu-doc.texi b/qemu-doc.texi index 47e1991..31199f6 100644 --- a/qemu-doc.texi +++ b/qemu-doc.texi @@ -288,6 +288,14 @@ then the modifier is Ctrl-Alt-Shift (instead of Ctrl-Alt) and if you use @kindex Ctrl-Alt-f Toggle full screen +@item Ctrl-Alt-+ +@kindex Ctrl-Alt-+ +Enlarge the screen + +@item Ctrl-Alt-- +@kindex Ctrl-Alt-- +Shrink the screen + @item Ctrl-Alt-u @kindex Ctrl-Alt-u Restore the screen's un-scaled dimensions diff --git a/ui/sdl.c b/ui/sdl.c index e8ac3bb..fc63c8e 100644 --- a/ui/sdl.c +++ b/ui/sdl.c @@ -651,6 +651,19 @@ static void sdl_refresh(DisplayState *ds) absolute_mouse_grab(); } break; + case 0x1b: /* '+' */ + case 0x35: /* '-' */ + if (!gui_fullscreen) { + int width = MAX(real_screen->w + + (keycode == 0x1b ? 50 : -50), 160); + int height = (ds_get_height(ds) * width) / + ds_get_width(ds); + + sdl_scale(ds, width, height); + vga_hw_invalidate(); + vga_hw_update(); + gui_keysym = 1; + } default: break; }