summaryrefslogtreecommitdiff
path: root/platform/osx/os_osx.mm
diff options
context:
space:
mode:
Diffstat (limited to 'platform/osx/os_osx.mm')
-rw-r--r--platform/osx/os_osx.mm19
1 files changed, 18 insertions, 1 deletions
diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm
index 33b1e64dd4..a0fc53d517 100644
--- a/platform/osx/os_osx.mm
+++ b/platform/osx/os_osx.mm
@@ -137,6 +137,11 @@ static bool mouse_down_control = false;
//_GodotInputMonitorChange();
}
+- (void)showAbout:(id)sender {
+ if (OS_OSX::singleton->get_main_loop())
+ OS_OSX::singleton->get_main_loop()->notification(MainLoop::NOTIFICATION_WM_ABOUT);
+}
+
@end
@interface GodotWindowDelegate : NSObject {
@@ -1428,6 +1433,10 @@ void OS_OSX::set_current_screen(int p_screen) {
};
Point2 OS_OSX::get_screen_position(int p_screen) const {
+ if (p_screen == -1) {
+ p_screen = get_current_screen();
+ }
+
NSArray *screenArray = [NSScreen screens];
if (p_screen < [screenArray count]) {
float displayScale = 1.0;
@@ -1444,6 +1453,10 @@ Point2 OS_OSX::get_screen_position(int p_screen) const {
}
int OS_OSX::get_screen_dpi(int p_screen) const {
+ if (p_screen == -1) {
+ p_screen = get_current_screen();
+ }
+
NSArray *screenArray = [NSScreen screens];
if (p_screen < [screenArray count]) {
float displayScale = 1.0;
@@ -1464,6 +1477,10 @@ int OS_OSX::get_screen_dpi(int p_screen) const {
}
Size2 OS_OSX::get_screen_size(int p_screen) const {
+ if (p_screen == -1) {
+ p_screen = get_current_screen();
+ }
+
NSArray *screenArray = [NSScreen screens];
if (p_screen < [screenArray count]) {
float displayScale = 1.0;
@@ -1902,7 +1919,7 @@ OS_OSX::OS_OSX() {
// Setup Apple menu
NSMenu *apple_menu = [[NSMenu alloc] initWithTitle:@""];
title = [NSString stringWithFormat:NSLocalizedString(@"About %@", nil), nsappname];
- [apple_menu addItemWithTitle:title action:@selector(orderFrontStandardAboutPanel:) keyEquivalent:@""];
+ [apple_menu addItemWithTitle:title action:@selector(showAbout:) keyEquivalent:@""];
[apple_menu addItem:[NSMenuItem separatorItem]];