1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Sync display/window/size/initial_position_type and Window::WINDOW_INITIAL_POSITION_ enum.

This commit is contained in:
Pāvels Nadtočajevs
2025-03-11 08:24:23 +02:00
parent 78c9f8ddd9
commit d990f594a0
3 changed files with 9 additions and 8 deletions

View File

@@ -2479,27 +2479,27 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
}
window_mode = (DisplayServer::WindowMode)(GLOBAL_GET("display/window/size/mode").operator int());
int initial_position_type = GLOBAL_GET("display/window/size/initial_position_type").operator int();
if (initial_position_type == 0) { // Absolute.
if (initial_position_type == Window::WINDOW_INITIAL_POSITION_ABSOLUTE) { // Absolute.
if (!init_use_custom_pos) {
init_custom_pos = GLOBAL_GET("display/window/size/initial_position").operator Vector2i();
init_use_custom_pos = true;
}
} else if (initial_position_type == 1) { // Center of Primary Screen.
} else if (initial_position_type == Window::WINDOW_INITIAL_POSITION_CENTER_PRIMARY_SCREEN || initial_position_type == Window::WINDOW_INITIAL_POSITION_CENTER_MAIN_WINDOW_SCREEN) { // Center of Primary Screen.
if (!init_use_custom_screen) {
init_screen = DisplayServer::SCREEN_PRIMARY;
init_use_custom_screen = true;
}
} else if (initial_position_type == 2) { // Center of Other Screen.
} else if (initial_position_type == Window::WINDOW_INITIAL_POSITION_CENTER_OTHER_SCREEN) { // Center of Other Screen.
if (!init_use_custom_screen) {
init_screen = GLOBAL_GET("display/window/size/initial_screen").operator int();
init_use_custom_screen = true;
}
} else if (initial_position_type == 3) { // Center of Screen With Mouse Pointer.
} else if (initial_position_type == Window::WINDOW_INITIAL_POSITION_CENTER_SCREEN_WITH_MOUSE_FOCUS) { // Center of Screen With Mouse Pointer.
if (!init_use_custom_screen) {
init_screen = DisplayServer::SCREEN_WITH_MOUSE_FOCUS;
init_use_custom_screen = true;
}
} else if (initial_position_type == 4) { // Center of Screen With Keyboard Focus.
} else if (initial_position_type == Window::WINDOW_INITIAL_POSITION_CENTER_SCREEN_WITH_KEYBOARD_FOCUS) { // Center of Screen With Keyboard Focus.
if (!init_use_custom_screen) {
init_screen = DisplayServer::SCREEN_WITH_KEYBOARD_FOCUS;
init_use_custom_screen = true;