qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@web.de>
To: Anthony Liguori <aliguori@us.ibm.com>,
	qemu-devel <qemu-devel@nongnu.org>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: [Qemu-devel] [PATCH 13/15] sdl: Add zoom hot keys
Date: Sat, 30 Jul 2011 11:39:16 +0200	[thread overview]
Message-ID: <afd088372bf1b678133740dd37fa91ff173f8bb4.1312018756.git.jan.kiszka@web.de> (raw)
In-Reply-To: <cover.1312018756.git.jan.kiszka@web.de>
In-Reply-To: <cover.1312018756.git.jan.kiszka@web.de>

From: Jan Kiszka <jan.kiszka@siemens.com>

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 <stefano.stabellini@eu.citrix.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 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;
                     }
-- 
1.7.3.4

  parent reply	other threads:[~2011-07-30  9:39 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-30  9:39 [Qemu-devel] [PATCH 00/15] sdl: Usability improvements Jan Kiszka
2011-07-30  9:39 ` [Qemu-devel] [PATCH 01/15] sdl: Fix termination in -no-shutdown mode Jan Kiszka
2011-07-30 12:57   ` Anthony Liguori
2011-07-30  9:39 ` [Qemu-devel] [PATCH 02/15] sdl: Do not make full screen mode resizable Jan Kiszka
2011-07-30  9:39 ` [Qemu-devel] [PATCH 03/15] sdl: Avoid redundant scaling deactivation Jan Kiszka
2011-07-30  9:39 ` [Qemu-devel] [PATCH 04/15] sdl: Properly mark modifier+u as hotkey Jan Kiszka
2011-07-30  9:39 ` [Qemu-devel] [PATCH 05/15] sdl: Fix full screen toggling from scaled mode Jan Kiszka
2011-07-30  9:39 ` [Qemu-devel] [PATCH 06/15] sdl: Restore scaling mode on return from full screen Jan Kiszka
2011-07-30  9:39 ` [Qemu-devel] [PATCH 07/15] sdl: Drop bogus gui_fullscreen_initial_grab Jan Kiszka
2011-07-30  9:39 ` [Qemu-devel] [PATCH 08/15] sdl: Initialize gui_fullscreen earlier during setup Jan Kiszka
2011-07-30  9:39 ` [Qemu-devel] [PATCH 09/15] sdl: Consistently avoid grabbing input for text consoles Jan Kiszka
2011-07-30  9:39 ` [Qemu-devel] [PATCH 10/15] sdl: Never release input while in full screen mode Jan Kiszka
2011-07-30  9:39 ` [Qemu-devel] [PATCH 11/15] sdl: Fix cursor handling when switching consoles in absolute mouse mode Jan Kiszka
2011-07-30  9:39 ` [Qemu-devel] [PATCH 12/15] sdl: Dynamically grab input " Jan Kiszka
2011-07-30  9:39 ` Jan Kiszka [this message]
2011-07-30  9:39 ` [Qemu-devel] [PATCH 14/15] sdl: Factor out event handlers from sdl_refresh Jan Kiszka
2011-07-30  9:39 ` [Qemu-devel] [PATCH 15/15] sdl: Refactor sdl_send_mouse_event Jan Kiszka
2011-08-01  0:28 ` [Qemu-devel] [PATCH 00/15] sdl: Usability improvements Anthony Liguori
2011-08-05 16:47 ` Anthony Liguori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=afd088372bf1b678133740dd37fa91ff173f8bb4.1312018756.git.jan.kiszka@web.de \
    --to=jan.kiszka@web.de \
    --cc=aliguori@us.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefano.stabellini@eu.citrix.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).