summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-03-26 15:51:40 +0100
committerGitHub <noreply@github.com>2022-03-26 15:51:40 +0100
commitcd43ab38d718fb4bb227c09525f04cf7189f7182 (patch)
treed5ed33327aaf87384484bd120b4e120aeb146852
parentfec24869948ae07d615b31b984296b60505c1671 (diff)
parent56d372ef0cf66d7960a8109c0563d5df817e458a (diff)
Merge pull request #59542 from fountainment/fix_pm_window_pos
-rw-r--r--editor/project_manager.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp
index d011d7a7e7..0879d0dd18 100644
--- a/editor/project_manager.cpp
+++ b/editor/project_manager.cpp
@@ -2872,10 +2872,11 @@ ProjectManager::ProjectManager() {
if (scale_factor > 1.0) {
Vector2i window_size = DisplayServer::get_singleton()->window_get_size();
Vector2i screen_size = DisplayServer::get_singleton()->screen_get_size();
+ Vector2i screen_position = DisplayServer::get_singleton()->screen_get_position();
window_size *= scale_factor;
Vector2i window_position;
- window_position.x = (screen_size.x - window_size.x) / 2;
- window_position.y = (screen_size.y - window_size.y) / 2;
+ window_position.x = screen_position.x + (screen_size.x - window_size.x) / 2;
+ window_position.y = screen_position.y + (screen_size.y - window_size.y) / 2;
DisplayServer::get_singleton()->window_set_size(window_size);
DisplayServer::get_singleton()->window_set_position(window_position);
}