diff options
author | Jan Kiszka <jan.kiszka@siemens.com> | 2011-07-30 11:39:16 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2011-08-05 10:57:35 -0500 |
commit | d6a65ba333ce3af34721e1452a1206233ac2a3e5 (patch) | |
tree | 6df77a59ddf49c1e6876f56164c63cf7be94fb00 /ui | |
parent | 35b0f237205dc6a5c9aa3eae14f19ef4d37dafcd (diff) | |
download | qemu-d6a65ba333ce3af34721e1452a1206233ac2a3e5.zip qemu-d6a65ba333ce3af34721e1452a1206233ac2a3e5.tar.gz qemu-d6a65ba333ce3af34721e1452a1206233ac2a3e5.tar.bz2 |
sdl: Add zoom hot keys
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>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'ui')
-rw-r--r-- | ui/sdl.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -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; } |