summaryrefslogtreecommitdiff
path: root/platform/macos/os_macos.mm
diff options
context:
space:
mode:
Diffstat (limited to 'platform/macos/os_macos.mm')
-rw-r--r--platform/macos/os_macos.mm27
1 files changed, 23 insertions, 4 deletions
diff --git a/platform/macos/os_macos.mm b/platform/macos/os_macos.mm
index 35c4e4b03d..e620b058d3 100644
--- a/platform/macos/os_macos.mm
+++ b/platform/macos/os_macos.mm
@@ -56,10 +56,11 @@ _FORCE_INLINE_ String OS_MacOS::get_framework_executable(const String &p_path) {
}
void OS_MacOS::pre_wait_observer_cb(CFRunLoopObserverRef p_observer, CFRunLoopActivity p_activiy, void *p_context) {
- // Prevent main loop from sleeping and redraw window during resize / modal popups.
+ // Prevent main loop from sleeping and redraw window during modal popup display.
+ // Do not redraw when rendering is done from the separate thread, it will conflict with the OpenGL context updates.
DisplayServerMacOS *ds = (DisplayServerMacOS *)DisplayServer::get_singleton();
- if (get_singleton()->get_main_loop() && ds && (get_singleton()->get_render_thread_mode() != RENDER_SEPARATE_THREAD || !ds->get_is_resizing())) {
+ if (get_singleton()->get_main_loop() && ds && (get_singleton()->get_render_thread_mode() != RENDER_SEPARATE_THREAD) && !ds->get_is_resizing()) {
Main::force_redraw();
if (!Main::is_iterating()) { // Avoid cyclic loop.
Main::iteration();
@@ -133,14 +134,25 @@ String OS_MacOS::get_name() const {
return "macOS";
}
+String OS_MacOS::get_distribution_name() const {
+ return get_name();
+}
+
+String OS_MacOS::get_version() const {
+ NSOperatingSystemVersion ver = [NSProcessInfo processInfo].operatingSystemVersion;
+ return vformat("%d.%d.%d", (int64_t)ver.majorVersion, (int64_t)ver.minorVersion, (int64_t)ver.patchVersion);
+}
+
void OS_MacOS::alert(const String &p_alert, const String &p_title) {
NSAlert *window = [[NSAlert alloc] init];
NSString *ns_title = [NSString stringWithUTF8String:p_title.utf8().get_data()];
NSString *ns_alert = [NSString stringWithUTF8String:p_alert.utf8().get_data()];
+ NSTextField *text_field = [NSTextField labelWithString:ns_alert];
+ [text_field setAlignment:NSTextAlignmentCenter];
[window addButtonWithTitle:@"OK"];
[window setMessageText:ns_title];
- [window setInformativeText:ns_alert];
+ [window setAccessoryView:text_field];
[window setAlertStyle:NSAlertStyleWarning];
id key_window = [[NSApplication sharedApplication] keyWindow];
@@ -487,7 +499,14 @@ String OS_MacOS::get_unique_id() const {
}
bool OS_MacOS::_check_internal_feature_support(const String &p_feature) {
- return p_feature == "pc";
+ if (p_feature == "system_fonts") {
+ return true;
+ }
+ if (p_feature == "pc") {
+ return true;
+ }
+
+ return false;
}
void OS_MacOS::disable_crash_handler() {