summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorbruvzg <7645683+bruvzg@users.noreply.github.com>2023-01-19 10:28:53 +0200
committerbruvzg <7645683+bruvzg@users.noreply.github.com>2023-01-19 13:44:06 +0200
commitaade5abd4f3ff17d00d7b742a139f6894c3a1de2 (patch)
tree56dfc5d6e364dee34cd5de5b0afd9d0f95a9f7e0 /main
parentcd0a9ccdfde05963d1b544b773662149f585da0d (diff)
Reorganize main and sub-window initial position properties.
Diffstat (limited to 'main')
-rw-r--r--main/main.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/main/main.cpp b/main/main.cpp
index e5d2ea3922..dc4bdc648f 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -185,6 +185,7 @@ static bool init_maximized = false;
static bool init_windowed = false;
static bool init_always_on_top = false;
static bool init_use_custom_pos = false;
+static bool init_use_custom_screen = false;
static Vector2 init_custom_pos;
// Debug
@@ -964,6 +965,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
if (I->next()) {
init_screen = I->next()->get().to_int();
+ init_use_custom_screen = true;
N = I->next()->next();
} else {
@@ -1669,7 +1671,23 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
window_flags |= DisplayServer::WINDOW_FLAG_NO_FOCUS_BIT;
}
window_mode = (DisplayServer::WindowMode)(GLOBAL_GET("display/window/size/mode").operator int());
- init_screen = GLOBAL_GET("display/window/size/initial_screen").operator int();
+ int initial_position_type = GLOBAL_GET("display/window/size/initial_position_type").operator int();
+ if (initial_position_type == 0) {
+ 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) {
+ if (!init_use_custom_screen) {
+ init_screen = DisplayServer::SCREEN_PRIMARY;
+ init_use_custom_screen = true;
+ }
+ } else if (initial_position_type == 2) {
+ if (!init_use_custom_screen) {
+ init_screen = GLOBAL_GET("display/window/size/initial_screen").operator int();
+ init_use_custom_screen = true;
+ }
+ }
}
GLOBAL_DEF("internationalization/locale/include_text_server_data", false);