[Settings]bring up maximized window fix (#14510)

This commit is contained in:
Davide Giacometti 2021-11-18 12:38:16 +01:00 committed by GitHub
parent 36bbce78d7
commit 105f94690d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;
}