Fix window restoring after fullscreen again
This commit is contained in:
parent
41e9028868
commit
8a2bc6bf58
|
@ -903,6 +903,9 @@ void DisplayServerWindows::_get_window_style(bool p_main_window, bool p_fullscre
|
|||
r_style = WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU;
|
||||
}
|
||||
}
|
||||
if (!p_borderless) {
|
||||
r_style |= WS_VISIBLE;
|
||||
}
|
||||
|
||||
if (p_no_activate_focus) {
|
||||
r_style_ex |= WS_EX_TOPMOST | WS_EX_NOACTIVATE;
|
||||
|
@ -910,7 +913,7 @@ void DisplayServerWindows::_get_window_style(bool p_main_window, bool p_fullscre
|
|||
r_style |= WS_CLIPCHILDREN | WS_CLIPSIBLINGS;
|
||||
}
|
||||
|
||||
void DisplayServerWindows::_update_window_style(WindowID p_window, bool p_repaint, bool p_maximized) {
|
||||
void DisplayServerWindows::_update_window_style(WindowID p_window, bool p_repaint) {
|
||||
_THREAD_SAFE_METHOD_
|
||||
|
||||
ERR_FAIL_COND(!windows.has(p_window));
|
||||
|
@ -943,6 +946,7 @@ void DisplayServerWindows::window_set_mode(WindowMode p_mode, WindowID p_window)
|
|||
RECT rect;
|
||||
|
||||
wd.fullscreen = false;
|
||||
wd.maximized = wd.was_maximized;
|
||||
|
||||
if (wd.pre_fs_valid) {
|
||||
rect = wd.pre_fs_rect;
|
||||
|
@ -951,13 +955,16 @@ void DisplayServerWindows::window_set_mode(WindowMode p_mode, WindowID p_window)
|
|||
rect.right = wd.width;
|
||||
rect.top = 0;
|
||||
rect.bottom = wd.height;
|
||||
wd.pre_fs_valid = true;
|
||||
}
|
||||
|
||||
_update_window_style(p_window, false, wd.was_maximized);
|
||||
_update_window_style(p_window, false);
|
||||
|
||||
MoveWindow(wd.hWnd, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, TRUE);
|
||||
|
||||
wd.pre_fs_valid = true;
|
||||
} else if (p_mode == WINDOW_MODE_WINDOWED) {
|
||||
ShowWindow(wd.hWnd, SW_RESTORE);
|
||||
wd.maximized = false;
|
||||
wd.minimized = false;
|
||||
}
|
||||
|
||||
if (p_mode == WINDOW_MODE_MAXIMIZED) {
|
||||
|
@ -966,12 +973,6 @@ void DisplayServerWindows::window_set_mode(WindowMode p_mode, WindowID p_window)
|
|||
wd.minimized = false;
|
||||
}
|
||||
|
||||
if (p_mode == WINDOW_MODE_WINDOWED) {
|
||||
ShowWindow(wd.hWnd, SW_RESTORE);
|
||||
wd.maximized = false;
|
||||
wd.minimized = false;
|
||||
}
|
||||
|
||||
if (p_mode == WINDOW_MODE_MINIMIZED) {
|
||||
ShowWindow(wd.hWnd, SW_MINIMIZE);
|
||||
wd.maximized = false;
|
||||
|
@ -2992,6 +2993,9 @@ DisplayServer::WindowID DisplayServerWindows::_create_window(WindowMode p_mode,
|
|||
windows.erase(id);
|
||||
return INVALID_WINDOW_ID;
|
||||
}
|
||||
if (p_mode != WINDOW_MODE_FULLSCREEN) {
|
||||
wd.pre_fs_valid = true;
|
||||
}
|
||||
#ifdef VULKAN_ENABLED
|
||||
|
||||
if (rendering_driver == "vulkan") {
|
||||
|
|
|
@ -417,7 +417,7 @@ private:
|
|||
void _drag_event(WindowID p_window, float p_x, float p_y, int idx);
|
||||
void _touch_event(WindowID p_window, bool p_pressed, float p_x, float p_y, int idx);
|
||||
|
||||
void _update_window_style(WindowID p_window, bool p_repaint = true, bool p_maximized = false);
|
||||
void _update_window_style(WindowID p_window, bool p_repaint = true);
|
||||
void _update_window_mouse_passthrough(WindowID p_window);
|
||||
|
||||
void _update_real_mouse_position(WindowID p_window);
|
||||
|
|
Loading…
Reference in New Issue