Browse Source

cocoa: fix app launching regression on macOS

The regression was introduced by ef7f856c46299f4d14711130269f11afad49e4c3

Fixes #227
rdb 8 years ago
parent
commit
fe0c182830

+ 0 - 1
panda/src/cocoadisplay/cocoaGraphicsPipe.mm

@@ -15,7 +15,6 @@
 #include "cocoaGraphicsBuffer.h"
 #include "cocoaGraphicsBuffer.h"
 #include "cocoaGraphicsWindow.h"
 #include "cocoaGraphicsWindow.h"
 #include "cocoaGraphicsStateGuardian.h"
 #include "cocoaGraphicsStateGuardian.h"
-#include "cocoaPandaApp.h"
 #include "config_cocoadisplay.h"
 #include "config_cocoadisplay.h"
 #include "frameBufferProperties.h"
 #include "frameBufferProperties.h"
 #include "displayInformation.h"
 #include "displayInformation.h"

+ 3 - 0
panda/src/cocoadisplay/cocoaGraphicsWindow.mm

@@ -15,6 +15,7 @@
 #include "cocoaGraphicsStateGuardian.h"
 #include "cocoaGraphicsStateGuardian.h"
 #include "config_cocoadisplay.h"
 #include "config_cocoadisplay.h"
 #include "cocoaGraphicsPipe.h"
 #include "cocoaGraphicsPipe.h"
+#include "cocoaPandaApp.h"
 
 
 #include "graphicsPipe.h"
 #include "graphicsPipe.h"
 #include "keyboardButton.h"
 #include "keyboardButton.h"
@@ -68,6 +69,8 @@ CocoaGraphicsWindow(GraphicsEngine *engine, GraphicsPipe *pipe,
   // Now that we know for sure we want a window, we can create the Cocoa app.
   // Now that we know for sure we want a window, we can create the Cocoa app.
   // This will cause the application icon to appear and start bouncing.
   // This will cause the application icon to appear and start bouncing.
   if (NSApp == nil) {
   if (NSApp == nil) {
+    [CocoaPandaApp sharedApplication];
+
 #if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1060
 #if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1060
     [NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
     [NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
 #endif
 #endif