[vlc-commits] vout:win32: handle the video-x/y position in the vout_window_t

Steve Lhomme git at videolan.org
Tue Apr 2 16:33:15 CEST 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Mar 29 09:37:27 2019 +0100| [a177f9f637e81f3b9feec783cd0ae8b6d242e239] | committer: Steve Lhomme

vout:win32: handle the video-x/y position in the vout_window_t

The value could also be used to position the video in the wallpaper (until it
may also use a proper vout_window_t).

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a177f9f637e81f3b9feec783cd0ae8b6d242e239
---

 include/vlc_vout_window.h           | 2 +-
 modules/video_output/win32/window.c | 4 ++++
 src/video_output/video_output.c     | 2 +-
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/include/vlc_vout_window.h b/include/vlc_vout_window.h
index 916bc2e333..11752116bf 100644
--- a/include/vlc_vout_window.h
+++ b/include/vlc_vout_window.h
@@ -154,7 +154,7 @@ typedef struct vout_window_cfg_t {
      */
     bool is_decorated;
 
-#ifdef __APPLE__
+#if defined(__APPLE__) || defined(_WIN32)
     /* Window position hint */
     int x;
     int y;
diff --git a/modules/video_output/win32/window.c b/modules/video_output/win32/window.c
index 7de2395113..75da962351 100644
--- a/modules/video_output/win32/window.c
+++ b/modules/video_output/win32/window.c
@@ -103,7 +103,11 @@ static int Enable(vout_window_t *wnd, const vout_window_cfg_t *cfg)
         i_window_style |= WS_DISABLED;
     SetWindowLong(sys->hwnd, GWL_STYLE, i_window_style);
 
+    if (cfg->x || cfg->y)
+        MoveWindow(sys->hwnd, cfg->x, cfg->y, cfg->width, cfg->height, TRUE);
+
     Resize(wnd, cfg->width, cfg->height);
+
     ShowWindow( sys->hwnd, SW_SHOW );
     return VLC_SUCCESS;
 }
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 3ae0694774..d38b23c6ab 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -1853,7 +1853,7 @@ int vout_Request(const vout_configuration_t *cfg, input_thread_t *input)
             .is_fullscreen = var_GetBool(vout, "fullscreen"),
             .is_decorated = var_InheritBool(vout, "video-deco"),
         // TODO: take pixel A/R, crop and zoom into account
-#ifdef __APPLE__
+#if defined(__APPLE__) || defined(_WIN32)
             .x = var_InheritInteger(vout, "video-x"),
             .y = var_InheritInteger(vout, "video-y"),
 #endif



More information about the vlc-commits mailing list