summaryrefslogtreecommitdiffstats
path: root/video/out
diff options
context:
space:
mode:
authorAvi Halachmi (:avih) <avihpit@yahoo.com>2022-02-01 08:22:35 +0200
committeravih <avih@users.noreply.github.com>2022-02-02 13:05:55 +0200
commit555c15efba09c3f4ed0696606d8533cb82ee11a0 (patch)
tree68c421f71d07651885fb475c6f1cc79c0fdf7593 /video/out
parent8172c501ac074af8ec02d32d7e1864700e8ec69a (diff)
downloadmpv-555c15efba09c3f4ed0696606d8533cb82ee11a0.tar.bz2
mpv-555c15efba09c3f4ed0696606d8533cb82ee11a0.tar.xz
win32: apply geometry position to content instead of window
The docs specify that the +-X+-Y geometry values position the content. This used to work correctly but got broken at 8fb4fd9a . Geometry size is unaffected - this only concerns position. Commit 8fb4fd9a made it center the window rather than the content by taking the borders into account during positioning, but forgot to make an exception when a position is specified explicitly. This commit adds this exception, and now if a specific position is requested then the borders are ignored, and the content is positioned correctly.
Diffstat (limited to 'video/out')
-rw-r--r--video/out/w32_common.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/video/out/w32_common.c b/video/out/w32_common.c
index b899922f08..a69048414d 100644
--- a/video/out/w32_common.c
+++ b/video/out/w32_common.c
@@ -1419,8 +1419,13 @@ static void gui_thread_reconfig(void *ptr)
struct vo *vo = w32->vo;
RECT r = get_working_area(w32);
- if (!w32->current_fs && !IsMaximized(w32->window) && w32->opts->border)
+ // for normal window which is auto-positioned (centered), center the window
+ // rather than the content (by subtracting the borders from the work area)
+ if (!w32->current_fs && !IsMaximized(w32->window) && w32->opts->border &&
+ !w32->opts->geometry.xy_valid /* specific position not requested */)
+ {
subtract_window_borders(w32, w32->window, &r);
+ }
struct mp_rect screen = { r.left, r.top, r.right, r.bottom };
struct vo_win_geometry geo;