Skip to content

Commit

Permalink
Merge pull request #83824 from bruvzg/init_screen_mouse_kbd
Browse files Browse the repository at this point in the history
Fix missing initial position modes for the main window.
  • Loading branch information
akien-mga committed Oct 23, 2023
2 parents 5e8bf6a + f8829c8 commit 13144de
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1960,21 +1960,31 @@ 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) {
if (initial_position_type == 0) { // 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) {
} else if (initial_position_type == 1) { // 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) {
} else if (initial_position_type == 2) { // 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.
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.
if (!init_use_custom_screen) {
init_screen = DisplayServer::SCREEN_WITH_KEYBOARD_FOCUS;
init_use_custom_screen = true;
}
}
}

Expand Down

0 comments on commit 13144de

Please sign in to comment.