|
@@ -1876,6 +1876,8 @@ void OS_Windows::set_window_fullscreen(bool p_enabled) {
|
|
|
|
|
|
if (p_enabled) {
|
|
if (p_enabled) {
|
|
|
|
|
|
|
|
+ was_maximized = maximized;
|
|
|
|
+
|
|
if (pre_fs_valid) {
|
|
if (pre_fs_valid) {
|
|
GetWindowRect(hWnd, &pre_fs_rect);
|
|
GetWindowRect(hWnd, &pre_fs_rect);
|
|
}
|
|
}
|
|
@@ -1905,7 +1907,7 @@ void OS_Windows::set_window_fullscreen(bool p_enabled) {
|
|
rect.bottom = video_mode.height;
|
|
rect.bottom = video_mode.height;
|
|
}
|
|
}
|
|
|
|
|
|
- _update_window_style(false);
|
|
|
|
|
|
+ _update_window_style(false, was_maximized);
|
|
|
|
|
|
MoveWindow(hWnd, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, TRUE);
|
|
MoveWindow(hWnd, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, TRUE);
|
|
|
|
|
|
@@ -2087,12 +2089,16 @@ bool OS_Windows::get_borderless_window() {
|
|
return video_mode.borderless_window;
|
|
return video_mode.borderless_window;
|
|
}
|
|
}
|
|
|
|
|
|
-void OS_Windows::_update_window_style(bool repaint) {
|
|
|
|
|
|
+void OS_Windows::_update_window_style(bool p_repaint, bool p_maximized) {
|
|
if (video_mode.fullscreen || video_mode.borderless_window) {
|
|
if (video_mode.fullscreen || video_mode.borderless_window) {
|
|
SetWindowLongPtr(hWnd, GWL_STYLE, WS_SYSMENU | WS_POPUP | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_VISIBLE);
|
|
SetWindowLongPtr(hWnd, GWL_STYLE, WS_SYSMENU | WS_POPUP | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_VISIBLE);
|
|
} else {
|
|
} else {
|
|
if (video_mode.resizable) {
|
|
if (video_mode.resizable) {
|
|
- SetWindowLongPtr(hWnd, GWL_STYLE, WS_OVERLAPPEDWINDOW | WS_VISIBLE);
|
|
|
|
|
|
+ if (p_maximized) {
|
|
|
|
+ SetWindowLongPtr(hWnd, GWL_STYLE, WS_OVERLAPPEDWINDOW | WS_VISIBLE | WS_MAXIMIZE);
|
|
|
|
+ } else {
|
|
|
|
+ SetWindowLongPtr(hWnd, GWL_STYLE, WS_OVERLAPPEDWINDOW | WS_VISIBLE);
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
SetWindowLongPtr(hWnd, GWL_STYLE, WS_CAPTION | WS_MINIMIZEBOX | WS_POPUPWINDOW | WS_VISIBLE);
|
|
SetWindowLongPtr(hWnd, GWL_STYLE, WS_CAPTION | WS_MINIMIZEBOX | WS_POPUPWINDOW | WS_VISIBLE);
|
|
}
|
|
}
|
|
@@ -2100,7 +2106,7 @@ void OS_Windows::_update_window_style(bool repaint) {
|
|
|
|
|
|
SetWindowPos(hWnd, video_mode.always_on_top ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE);
|
|
SetWindowPos(hWnd, video_mode.always_on_top ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE);
|
|
|
|
|
|
- if (repaint) {
|
|
|
|
|
|
+ if (p_repaint) {
|
|
RECT rect;
|
|
RECT rect;
|
|
GetWindowRect(hWnd, &rect);
|
|
GetWindowRect(hWnd, &rect);
|
|
MoveWindow(hWnd, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, TRUE);
|
|
MoveWindow(hWnd, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, TRUE);
|
|
@@ -3247,6 +3253,7 @@ OS_Windows::OS_Windows(HINSTANCE _hInstance) {
|
|
control_mem = false;
|
|
control_mem = false;
|
|
meta_mem = false;
|
|
meta_mem = false;
|
|
minimized = false;
|
|
minimized = false;
|
|
|
|
+ was_maximized = false;
|
|
console_visible = IsWindowVisible(GetConsoleWindow());
|
|
console_visible = IsWindowVisible(GetConsoleWindow());
|
|
|
|
|
|
hInstance = _hInstance;
|
|
hInstance = _hInstance;
|