Win32: Allow return from fullscreen to maximized

If window is maximized when toggling fullscreen, go back to maximized when done.

Differential Revision: https://developer.blender.org/D10813

Reviewed by Harley Acheson
This commit is contained in:
Vincent Blankfield 2021-03-26 14:30:57 -07:00 committed by Harley Acheson
parent 0ec82477af
commit 9b87d3f029
Notes: blender-bot 2023-02-14 05:12:59 +01:00
Referenced by issue #86952, Heap Buffer Overflow when viewing dds thumbnails in the file browser.
1 changed files with 8 additions and 1 deletions

View File

@ -537,7 +537,14 @@ GHOST_TSuccess GHOST_WindowWin32::setState(GHOST_TWindowState state)
break;
case GHOST_kWindowStateNormal:
default:
wp.showCmd = SW_SHOWNORMAL;
if (curstate == GHOST_kWindowStateFullScreen &&
m_normal_state == GHOST_kWindowStateMaximized) {
wp.showCmd = SW_SHOWMAXIMIZED;
m_normal_state = GHOST_kWindowStateNormal;
}
else {
wp.showCmd = SW_SHOWNORMAL;
}
break;
}
::SetWindowLongPtr(m_hWnd, GWL_STYLE, style);