qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Switch to disable SDL zoom
@ 2009-08-19 16:13 Antoine Kaufmann
  2009-08-28  0:28 ` Anthony Liguori
  0 siblings, 1 reply; 4+ messages in thread
From: Antoine Kaufmann @ 2009-08-19 16:13 UTC (permalink / raw)
  To: qemu-devel

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-08-28  8:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-19 16:13 [Qemu-devel] [PATCH] Switch to disable SDL zoom Antoine Kaufmann
2009-08-28  0:28 ` Anthony Liguori
2009-08-28  8:00   ` Samuel Thibault
2009-08-28  8:27   ` Gerd Hoffmann

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).