From 105f94690df6f5e5c5c697b8eb8f9d2d6b013134 Mon Sep 17 00:00:00 2001 From: Davide Giacometti Date: Thu, 18 Nov 2021 12:38:16 +0100 Subject: [PATCH] [Settings]bring up maximized window fix (#14510) --- src/runner/settings_window.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/runner/settings_window.cpp b/src/runner/settings_window.cpp index cb009dfef6..754bd95a2a 100644 --- a/src/runner/settings_window.cpp +++ b/src/runner/settings_window.cpp @@ -457,7 +457,17 @@ void bring_settings_to_front() } if (wcsncmp(title, windowTitle.c_str(), len) == 0) { - ShowWindow(hwnd, SW_RESTORE); + auto lStyles = GetWindowLong(hwnd, GWL_STYLE); + + if (lStyles & WS_MAXIMIZE) + { + ShowWindow(hwnd, SW_MAXIMIZE); + } + else + { + ShowWindow(hwnd, SW_RESTORE); + } + SetForegroundWindow(hwnd); return FALSE; }