From 8ca11dda9e73865ccb97c1c3563c1f10b226f633 Mon Sep 17 00:00:00 2001 From: Uoti Urpala Date: Fri, 20 Mar 2009 15:22:15 +0200 Subject: [PATCH] VO: Don't force window position in X11 VOs Disable by default the code that forcefully moved the video output window to the middle of the screen whenever it was reconfigured or created. That behavior was really annoying when switching video streams within a file, and overriding the window manager like that is not good default behavior for the initial creation of a window either. Add a new option "-force-window-position" that can be used to restore the old behavior. --- DOCS/man/en/mplayer.1 | 7 +++++++ cfg-mplayer.h | 2 ++ libvo/x11_common.c | 6 +++++- options.h | 1 + 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/DOCS/man/en/mplayer.1 b/DOCS/man/en/mplayer.1 index 3b6c1873d8..cec09f8735 100644 --- a/DOCS/man/en/mplayer.1 +++ b/DOCS/man/en/mplayer.1 @@ -3055,6 +3055,13 @@ VESA framebuffer does not support mode changing. Override framebuffer mode configuration file (default: /etc/\:fb.modes). . .TP +.B \-force\-window\-position +Forcefully move MPlayer's video output window to default location whenever +there is a change in video parameters, video stream or file. +This used to be the default behavior. +Currently only affects X11 VOs. +. +.TP .B \-fs (also see \-zoom) Fullscreen playback (centers movie, and paints black bands around it). Not supported by all video output drivers. diff --git a/cfg-mplayer.h b/cfg-mplayer.h index 5fe0bff69c..152b9bf9bd 100644 --- a/cfg-mplayer.h +++ b/cfg-mplayer.h @@ -160,6 +160,8 @@ const m_option_t mplayer_opts[]={ OPT_INTRANGE("screenh", vo_screenheight, CONF_OLD, 0, 4096), // Geometry string {"geometry", &vo_geometry, CONF_TYPE_STRING, 0, 0, 0, NULL}, + OPT_FLAG_ON("force-window-position", force_window_position, 0), + OPT_FLAG_OFF("noforce-window-position", force_window_position, 0), // set aspect ratio of monitor - useful for 16:9 TV-out OPT_FLOATRANGE("monitoraspect", force_monitor_aspect, 0, 0.0, 9.0), OPT_FLOATRANGE("monitorpixelaspect", monitor_pixel_aspect, 0, 0.2, 9.0), diff --git a/libvo/x11_common.c b/libvo/x11_common.c index b70c0b8dd6..434cdbd04c 100644 --- a/libvo/x11_common.c +++ b/libvo/x11_common.c @@ -933,7 +933,11 @@ static void vo_x11_nofs_sizepos(struct vo *vo, int x, int y, { vo->dwidth = width; vo->dheight = height; - XMoveResizeWindow(vo->x11->display, vo->x11->window, x, y, width, height); + if (vo->opts->force_window_position) + XMoveResizeWindow(vo->x11->display, vo->x11->window, x, y, width, + height); + else + XResizeWindow(vo->x11->display, vo->x11->window, width, height); } } diff --git a/options.h b/options.h index 2f35fe2a76..7e1a67c2b9 100644 --- a/options.h +++ b/options.h @@ -10,6 +10,7 @@ typedef struct MPOpts { int screen_size_y; int vo_screenwidth; int vo_screenheight; + int force_window_position; float force_monitor_aspect; float monitor_pixel_aspect; int vidmode; -- 2.11.4.GIT