qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] Switch to disable SDL zoom


From: Antoine Kaufmann
Subject: [Qemu-devel] [PATCH] Switch to disable SDL zoom
Date: Wed, 19 Aug 2009 18:13:09 +0200

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 <address@hidden>
---
 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
address@hidden -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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]