mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
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>
This commit is contained in:
parent
35b0f23720
commit
d6a65ba333
2 changed files with 21 additions and 0 deletions
13
ui/sdl.c
13
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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue