From 6da3a15ca8f77e3b2dcfc21d09daa7aa246abd88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Tue, 8 Oct 2024 17:34:53 +0200 Subject: [PATCH] win32: keep prev_windowrc consistent also for maximized state --- video/out/w32_common.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/video/out/w32_common.c b/video/out/w32_common.c index 691ef3d57c..b5a835c80a 100644 --- a/video/out/w32_common.c +++ b/video/out/w32_common.c @@ -1117,7 +1117,10 @@ static void update_maximized_state(struct vo_w32_state *w32, bool leaving_fullsc if (w32->current_fs && !leaving_fullscreen) return; - bool toggle = !w32->opts->window_maximized && IsMaximized(w32->window); + bool toggle = w32->opts->window_maximized ^ IsMaximized(w32->window); + + if (toggle && !w32->current_fs && w32->opts->window_maximized) + w32->prev_windowrc = w32->windowrc; WINDOWPLACEMENT wp = { .length = sizeof wp }; GetWindowPlacement(w32->window, &wp); @@ -1139,7 +1142,7 @@ static void update_maximized_state(struct vo_w32_state *w32, bool leaving_fullsc } } - if (toggle && !w32->current_fs) { + if (toggle && !w32->current_fs && !w32->opts->window_maximized) { w32->windowrc = w32->prev_windowrc; update_window_state(w32); }