diff options
| author | Rémi Verschelde <rverschelde@gmail.com> | 2023-10-23 12:43:39 +0200 |
|---|---|---|
| committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-10-23 12:43:39 +0200 |
| commit | 13144dead8d78f149cccc186c883d33fea9bfb25 (patch) | |
| tree | 8461f35f9c0f8d2b722f14c19517dbda4cd5691e /main/main.cpp | |
| parent | 5e8bf6addffa9752b90289f90f0fcce58961e677 (diff) | |
| parent | f8829c80bb793e3b9d14ddd5e9154e70ef0bccd6 (diff) | |
| download | redot-engine-13144dead8d78f149cccc186c883d33fea9bfb25.tar.gz | |
Merge pull request #83824 from bruvzg/init_screen_mouse_kbd
Fix missing initial position modes for the main window.
Diffstat (limited to 'main/main.cpp')
| -rw-r--r-- | main/main.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/main/main.cpp b/main/main.cpp index c09b437757..dff661d207 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -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; + } } } |
