summaryrefslogtreecommitdiffstats
path: root/video/out/x11_common.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-01-23 10:56:11 +0100
committerwm4 <wm4@nowhere>2013-01-23 10:56:11 +0100
commit4c56baba4048f8a881253d4fe2f49c2715c77376 (patch)
treed75891df8cd30c404072f9b67b6da21188b79ba8 /video/out/x11_common.c
parentf2dcdca0c2dc5f904323659b65b29a2b6f00fd88 (diff)
downloadmpv-4c56baba4048f8a881253d4fe2f49c2715c77376.tar.bz2
mpv-4c56baba4048f8a881253d4fe2f49c2715c77376.tar.xz
options: move -geometry parsing to m_option.c
This also means the option is verified on program start, not when the VO is created. The actual code becomes a bit more complex, because the screen width/height is not available at program start. The actual parsing code is still the same, with its unusual sscanf() usage.
Diffstat (limited to 'video/out/x11_common.c')
-rw-r--r--video/out/x11_common.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/video/out/x11_common.c b/video/out/x11_common.c
index 7986817f68..9176165b8b 100644
--- a/video/out/x11_common.c
+++ b/video/out/x11_common.c
@@ -37,7 +37,6 @@
#include "vo.h"
#include "aspect.h"
-#include "geometry.h"
#include "osdep/timer.h"
#include <X11/Xmd.h>
@@ -1105,6 +1104,7 @@ void vo_x11_create_vo_window(struct vo *vo, XVisualInfo *vis, int x, int y,
struct MPOpts *opts = vo->opts;
struct vo_x11_state *x11 = vo->x11;
Display *mDisplay = vo->x11->display;
+ bool force_change_xy = opts->vo_geometry.xy_valid || xinerama_screen >= 0;
if (WinID >= 0) {
vo_fs = flags & VOFLAG_FULLSCREEN;
x11->window = WinID ? (Window)WinID : x11->rootwin;
@@ -1148,7 +1148,7 @@ void vo_x11_create_vo_window(struct vo *vo, XVisualInfo *vis, int x, int y,
hint.x = x; hint.y = y;
hint.width = width; hint.height = height;
hint.flags = PSize;
- if (geometry_xy_changed)
+ if (force_change_xy)
hint.flags |= PPosition;
XSetWMNormalHints(mDisplay, x11->window, &hint);
if (!vo_border) vo_x11_decoration(vo, 0);
@@ -1167,7 +1167,7 @@ void vo_x11_create_vo_window(struct vo *vo, XVisualInfo *vis, int x, int y,
}
vo_x11_update_window_title(vo);
if (opts->vo_ontop) vo_x11_setlayer(vo, x11->window, opts->vo_ontop);
- vo_x11_update_geometry(vo, !geometry_xy_changed);
+ vo_x11_update_geometry(vo, !force_change_xy);
vo_x11_nofs_sizepos(vo, vo->dx, vo->dy, width, height);
if (!!vo_fs != !!(flags & VOFLAG_FULLSCREEN))
vo_x11_fullscreen(vo);