From 174bcec30ed6ffb541e8a5b054e28da4a72b4667 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Tue, 21 Apr 2026 20:51:40 +0200 Subject: [PATCH] w32_common: support initial --fs and --window-maximized Don't set maximized window state if we are entering fullscreen too, this makes restoring later consistent. --- video/out/w32_common.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/video/out/w32_common.c b/video/out/w32_common.c index c12e568769..ba4f3825ec 100644 --- a/video/out/w32_common.c +++ b/video/out/w32_common.c @@ -1121,6 +1121,10 @@ static void update_fullscreen_state(struct vo_w32_state *w32) wp.showCmd = SW_SHOWNORMAL; SetWindowPlacement(w32->window, &wp); w32->pending_maximize = true; + } else if (w32->opts->window_maximized) { + // If the window was initialized directly in fullscreen mode, restore + // it to maximized state later. + w32->pending_maximize = true; } RECT r = w32->current_fs ? get_screen_area(w32) : w32->windowed_rect; @@ -1981,7 +1985,7 @@ set_pos_done: if (!is_visible(w32->window)) { if (w32->opts->window_minimized) { ShowWindow(w32->window, SW_SHOWMINNOACTIVE); - } else if (w32->opts->window_maximized) { + } else if (w32->opts->window_maximized && !w32->current_fs) { ShowWindow(w32->window, SW_SHOWMAXIMIZED); } else { ShowWindow(w32->window, SW_SHOW);