1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-29 16:16:38 +00:00

Add missing initial window flags and window mode to the project settings.

This commit is contained in:
bruvzg
2022-09-15 10:05:41 +03:00
parent 63c0dc690e
commit d104a4cdbd
8 changed files with 75 additions and 27 deletions

View File

@@ -685,7 +685,13 @@ void DisplayServerWindows::show_window(WindowID p_id) {
_update_window_style(p_id);
}
if (wd.no_focus || wd.is_popup) {
if (wd.maximized) {
ShowWindow(wd.hWnd, SW_SHOWMAXIMIZED);
SetForegroundWindow(wd.hWnd); // Slightly higher priority.
SetFocus(wd.hWnd); // Set keyboard focus.
} else if (wd.minimized) {
ShowWindow(wd.hWnd, SW_SHOWMINIMIZED);
} else if (wd.no_focus || wd.is_popup) {
// https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-showwindow
ShowWindow(wd.hWnd, SW_SHOWNA);
} else {
@@ -926,7 +932,7 @@ void DisplayServerWindows::window_set_position(const Point2i &p_position, Window
ERR_FAIL_COND(!windows.has(p_window));
WindowData &wd = windows[p_window];
if (wd.fullscreen) {
if (wd.fullscreen || wd.maximized) {
return;
}
@@ -1059,6 +1065,10 @@ void DisplayServerWindows::window_set_size(const Size2i p_size, WindowID p_windo
ERR_FAIL_COND(!windows.has(p_window));
WindowData &wd = windows[p_window];
if (wd.fullscreen || wd.maximized) {
return;
}
int w = p_size.width;
int h = p_size.height;
@@ -1076,10 +1086,6 @@ void DisplayServerWindows::window_set_size(const Size2i p_size, WindowID p_windo
}
#endif
if (wd.fullscreen) {
return;
}
RECT rect;
GetWindowRect(wd.hWnd, &rect);
@@ -3599,6 +3605,16 @@ DisplayServer::WindowID DisplayServerWindows::_create_window(WindowMode p_mode,
wd.wtctx = 0;
}
if (p_mode == WINDOW_MODE_MAXIMIZED) {
wd.maximized = true;
wd.minimized = false;
}
if (p_mode == WINDOW_MODE_MINIMIZED) {
wd.maximized = false;
wd.minimized = true;
}
wd.last_pressure = 0;
wd.last_pressure_update = 0;
wd.last_tilt = Vector2();