changeset 34614:f9f91ba805b9

SDL: add support for setting window position. Currently only works with -vo gl since -vo sdl does not yet call geometry().
author reimar
date Sun, 12 Feb 2012 19:03:19 +0000
parents b2c3288a3483
children 306ee51a2fa0
files libvo/sdl_common.c
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/sdl_common.c	Sun Feb 12 18:52:38 2012 +0000
+++ b/libvo/sdl_common.c	Sun Feb 12 19:03:19 2012 +0000
@@ -25,6 +25,7 @@
 #include "input/input.h"
 #include "input/mouse.h"
 #include "video_out.h"
+#include "geometry.h"
 
 static int old_w;
 static int old_h;
@@ -121,6 +122,11 @@
 #endif
     if (!vo_border)
         flags |= SDL_NOFRAME;
+    if (geometry_xy_changed) {
+        char envstr[20];
+        snprintf(envstr, sizeof(envstr), "%i,%i", vo_dx, vo_dy);
+        setenv("SDL_VIDEO_WINDOW_POS", envstr, 1);
+    }
     s = SDL_SetVideoMode(vo_dwidth, vo_dheight, bpp, flags);
     if (!s) {
       mp_msg(MSGT_VO, MSGL_FATAL, "SDL SetVideoMode failed: %s\n", SDL_GetError());