summaryrefslogtreecommitdiff
path: root/editor/project_manager.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-07-04 10:51:09 +0200
committerGitHub <noreply@github.com>2020-07-04 10:51:09 +0200
commit8ccb1cec915283f538eaf187592b850759a72a7b (patch)
treef3d64732e78a05712228605d33c457fce30ddef7 /editor/project_manager.cpp
parent9cec315ec0aeb7a105a9b0828e437b7d508f6dc1 (diff)
parentdf968d577ac6d1bca223cdaec83940bfb36ade64 (diff)
Merge pull request #40084 from bruvzg/macos_seamless_scaling
[macOS] Implement seamless display scaling.
Diffstat (limited to 'editor/project_manager.cpp')
-rw-r--r--editor/project_manager.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp
index 325d7c5ce6..5184793760 100644
--- a/editor/project_manager.cpp
+++ b/editor/project_manager.cpp
@@ -2336,10 +2336,10 @@ ProjectManager::ProjectManager() {
switch (display_scale) {
case 0: {
// Try applying a suitable display scale automatically
- const int screen = DisplayServer::get_singleton()->window_get_current_screen();
#ifdef OSX_ENABLED
- editor_set_scale(DisplayServer::get_singleton()->screen_get_scale(screen));
+ editor_set_scale(DisplayServer::get_singleton()->screen_get_max_scale());
#else
+ const int screen = DisplayServer::get_singleton()->window_get_current_screen();
editor_set_scale(DisplayServer::get_singleton()->screen_get_dpi(screen) >= 192 && DisplayServer::get_singleton()->screen_get_size(screen).x > 2000 ? 2.0 : 1.0);
#endif
} break;
@@ -2371,11 +2371,8 @@ ProjectManager::ProjectManager() {
// Define a minimum window size to prevent UI elements from overlapping or being cut off
DisplayServer::get_singleton()->window_set_min_size(Size2(750, 420) * EDSCALE);
-#ifndef OSX_ENABLED
- // The macOS platform implementation uses its own hiDPI window resizing code
// TODO: Resize windows on hiDPI displays on Windows and Linux and remove the line below
DisplayServer::get_singleton()->window_set_size(DisplayServer::get_singleton()->window_get_size() * MAX(1, EDSCALE));
-#endif
}
FileDialog::set_default_show_hidden_files(EditorSettings::get_singleton()->get("filesystem/file_dialog/show_hidden_files"));