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);
122
122
implementation
123
123
124
124
uses
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;
126
133
127
134
{ $IFDEF OSX}
128
135
var
@@ -225,10 +232,17 @@ procedure TPyDelphiApplication.SetDelphiObject(const Value: TApplication);
225
232
end ;
226
233
227
234
function TPyDelphiApplication.Initialize_Wrapper (AArgs: PPyObject): PPyObject;
235
+ { $IFDEF OSX}
236
+ var
237
+ App: NSApplication;
238
+ { $ENDIF OSX}
228
239
begin
229
240
Application.Initialize();
230
241
{ $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 );
232
246
// the main form standard creation way,
233
247
// due to MainMenu creation and others.
234
248
Application.CreateForm(TInternalMainForm, gDelphiMainForm);
You can’t perform that action at this time.
0 commit comments