summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2016-06-04 18:43:43 +0200
committerRémi Verschelde <remi@verschelde.fr>2016-06-04 18:43:43 +0200
commit5b6a8eca94301410b066def0303a132bdc833dd4 (patch)
treeb46f4b95599fcdb81b5d8f280d51956348335ec8
parent3ae61f22921520e473a9e95783f0fcc03a5c6a54 (diff)
parent76ab7d3886c5a5e7c777e3cd9869e7b428247c06 (diff)
Merge pull request #5035 from marcelofg55/master
Right click->Quit on the godot icon will close the application on OSX
-rw-r--r--platform/osx/os_osx.mm9
1 files changed, 4 insertions, 5 deletions
diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm
index 1d97ffacb6..b5503fcd73 100644
--- a/platform/osx/os_osx.mm
+++ b/platform/osx/os_osx.mm
@@ -139,12 +139,10 @@ static int button_mask=0;
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender
{
-/* _Godotwindow* window;
+ if (OS_OSX::singleton->get_main_loop())
+ OS_OSX::singleton->get_main_loop()->notification(MainLoop::NOTIFICATION_WM_QUIT_REQUEST);
- for (window = _Godot.windowListHead; window; window = window->next)
- _GodotInputWindowCloseRequest(window);
-*/
- return NSTerminateCancel;
+ return NSTerminateCancel;
}
- (void)applicationDidHide:(NSNotification *)notification
@@ -1463,6 +1461,7 @@ Point2 OS_OSX::get_window_position() const {
Size2 wp([window_object frame].origin.x, [window_object frame].origin.y);
wp*=display_scale;
+ return wp;
};