From: Antoine Kaufmann <toni@tyndur.org>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] Switch to disable SDL zoom
Date: Wed, 19 Aug 2009 18:13:09 +0200 [thread overview]
Message-ID: <1250698389-23005-1-git-send-email-toni@tyndur.org> (raw)
Command line switch to disable SDL zoom, because zoom is quite ugly with
window managers that use fixed layouts (like awesomewm). Especially
because there is no possibility to reset the window to the "correct"
size.
Signed-off-by: Antoine Kaufmann <toni@tyndur.org>
---
qemu-options.hx | 10 ++++++++++
sdl.c | 5 ++++-
sdl_zoom.h | 2 ++
vl.c | 5 +++++
4 files changed, 21 insertions(+), 1 deletions(-)
diff --git a/qemu-options.hx b/qemu-options.hx
index 38989f1..529236e 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -487,6 +487,16 @@ STEXI
Enable SDL.
ETEXI
+#ifdef CONFIG_SDL
+DEF("sdl-no-zoom", 0, QEMU_OPTION_sdl_no_zoom,
+ "-sdl-no-zoom Disable SDL zoom\n")
+#endif
+STEXI
+@item -sdl
+
+Disable SDL zoom.
+ETEXI
+
DEF("portrait", 0, QEMU_OPTION_portrait,
"-portrait rotate graphical output 90 deg left (only PXA LCD)\n")
STEXI
diff --git a/sdl.c b/sdl.c
index 36fb07f..69234fb 100644
--- a/sdl.c
+++ b/sdl.c
@@ -102,7 +102,10 @@ static void do_sdl_resize(int new_width, int new_height, int bpp)
// printf("resizing to %d %d\n", w, h);
- flags = SDL_HWSURFACE|SDL_ASYNCBLIT|SDL_HWACCEL|SDL_RESIZABLE;
+ flags = SDL_HWSURFACE|SDL_ASYNCBLIT|SDL_HWACCEL;
+ if (!sdl_no_zoom) {
+ flags |= SDL_RESIZABLE;
+ }
if (gui_fullscreen)
flags |= SDL_FULLSCREEN;
if (gui_noframe)
diff --git a/sdl_zoom.h b/sdl_zoom.h
index 74955bc..961b441 100644
--- a/sdl_zoom.h
+++ b/sdl_zoom.h
@@ -19,6 +19,8 @@
#define SMOOTHING_OFF 0
#define SMOOTHING_ON 1
+extern int sdl_no_zoom;
+
int sdl_zoom_blit(SDL_Surface *src_sfc, SDL_Surface *dst_sfc,
int smooth, SDL_Rect *src_rect);
diff --git a/vl.c b/vl.c
index 8b2b289..be72594 100644
--- a/vl.c
+++ b/vl.c
@@ -122,6 +122,7 @@ int main(int argc, char **argv)
#undef main
#define main qemu_main
#endif
+#include "sdl_zoom.h"
#endif /* CONFIG_SDL */
#ifdef CONFIG_COCOA
@@ -207,6 +208,7 @@ int graphic_depth = 15;
static int full_screen = 0;
#ifdef CONFIG_SDL
static int no_frame = 0;
+int sdl_no_zoom = 0;
#endif
int no_quit = 0;
CharDriverState *serial_hds[MAX_SERIAL_PORTS];
@@ -5348,6 +5350,9 @@ int main(int argc, char **argv, char **envp)
case QEMU_OPTION_sdl:
display_type = DT_SDL;
break;
+ case QEMU_OPTION_sdl_no_zoom:
+ sdl_no_zoom = 1;
+ break;
#endif
case QEMU_OPTION_pidfile:
pid_file = optarg;
--
1.6.3.3
next reply other threads:[~2009-08-19 16:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-19 16:13 Antoine Kaufmann [this message]
2009-08-28 0:28 ` [Qemu-devel] [PATCH] Switch to disable SDL zoom Anthony Liguori
2009-08-28 8:00 ` Samuel Thibault
2009-08-28 8:27 ` Gerd Hoffmann
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=1250698389-23005-1-git-send-email-toni@tyndur.org \
--to=toni@tyndur.org \
--cc=qemu-devel@nongnu.org \
/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).