File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -122,7 +122,14 @@   EInvalidFormClass = class(Exception);
122122implementation 
123123
124124uses 
125-   System.Types, System.IOUtils, System.Rtti, System.Messaging;
125+   { $IFDEF OSX} 
126+   Macapi.AppKit,
127+   FMX.Platform.Mac,
128+   { $ENDIF OSX} 
129+   System.Types,
130+   System.IOUtils,
131+   System.Rtti,
132+   System.Messaging;
126133
127134{ $IFDEF OSX} 
128135var 
@@ -225,10 +232,17 @@ procedure TPyDelphiApplication.SetDelphiObject(const Value: TApplication);
225232end ;
226233
227234function  TPyDelphiApplication.Initialize_Wrapper (AArgs: PPyObject): PPyObject;
235+ { $IFDEF OSX} 
236+ var 
237+   App: NSApplication;
238+ { $ENDIF OSX} 
228239begin 
229240  Application.Initialize();
230241  { $IFDEF OSX} 
231-   // The application initialization routine in macOS requires
242+   //  #397
243+   App := TNSApplication.Wrap(TNSApplication.OCClass.sharedApplication);
244+    if  App.ActivationPolicy > 0  then 
245+      App.setActivationPolicy(0 );
232246  // the main form standard creation way,
233247  // due to MainMenu creation and others.
234248  Application.CreateForm(TInternalMainForm, gDelphiMainForm);
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments