From cd9a3212897fa0b3f87ea8ac1ae17dd2b5312b9c Mon Sep 17 00:00:00 2001 From: jared Date: Wed, 21 Jan 2026 09:40:25 -0500 Subject: [PATCH] Fix PyObjC activation policy --- main.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 5278245..4a5e085 100644 --- a/main.py +++ b/main.py @@ -17,7 +17,8 @@ from AppKit import ( NSUserInterfaceLayoutOrientationVertical, NSLayoutAttributeCenterX, NSLayoutAttributeCenterY, NSLayoutAttributeWidth, NSLayoutAttributeHeight, NSLayoutAttributeTop, NSLayoutAttributeBottom, NSLayoutAttributeLeading, - NSLayoutAttributeTrailing, NSScrollView, NSTextView + NSLayoutAttributeTrailing, NSScrollView, NSTextView, + NSApplicationActivationPolicyRegular ) from Foundation import NSObject, NSTimer, NSDate @@ -201,7 +202,10 @@ class ItemSenseApp(NSObject): if __name__ == "__main__": app = NSApplication.sharedApplication() + app.setActivationPolicy_(NSApplicationActivationPolicyRegular) delegate = ItemSenseApp.alloc().init() app.setDelegate_(delegate) - NSApp.activateIgnoringOtherApps_(True) + + # Allow time for policy to take effect? Usually acceptable immediately. + app.activateIgnoringOtherApps_(True) app.run()