From patchwork Wed Aug 19 16:13:09 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antoine Kaufmann X-Patchwork-Id: 31659 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by bilbo.ozlabs.org (Postfix) with ESMTPS id 343B7B7B64 for ; Thu, 20 Aug 2009 02:13:44 +1000 (EST) Received: from localhost ([127.0.0.1]:39138 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mdnn8-0007Dk-Sv for incoming@patchwork.ozlabs.org; Wed, 19 Aug 2009 12:13:38 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mdnmi-0007Cx-5T for qemu-devel@nongnu.org; Wed, 19 Aug 2009 12:13:12 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mdnmh-0007CN-MX for qemu-devel@nongnu.org; Wed, 19 Aug 2009 12:13:11 -0400 Received: from [199.232.76.173] (port=58632 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mdnmh-0007CC-Ij for qemu-devel@nongnu.org; Wed, 19 Aug 2009 12:13:11 -0400 Received: from sv0.famkaufmann.info ([89.163.145.14]:47372) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mdnmh-0000F7-1W for qemu-devel@nongnu.org; Wed, 19 Aug 2009 12:13:11 -0400 Received: from localhost.localdomain (unknown [85.4.86.193]) by sv0.famkaufmann.info (Postfix) with ESMTPA id 065761DD4DC for ; Wed, 19 Aug 2009 18:13:09 +0200 (CEST) From: Antoine Kaufmann To: qemu-devel@nongnu.org Date: Wed, 19 Aug 2009 18:13:09 +0200 Message-Id: <1250698389-23005-1-git-send-email-toni@tyndur.org> X-Mailer: git-send-email 1.6.3.3 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: [Qemu-devel] [PATCH] Switch to disable SDL zoom X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 --- 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;