Skip to content

Commit

Permalink
fall back to legacy API to activate app for macOS 13 and earlier
Browse files Browse the repository at this point in the history
  • Loading branch information
samschott committed Mar 25, 2024
1 parent 2da0108 commit 12adb03
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/maestral_cocoa/private/implementation/cocoa/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@


macos_version, *_ = platform.mac_ver()

macos_major_version = int(macos_version.split(".")[0])

# ==== icons ===========================================================================

Expand Down Expand Up @@ -707,7 +707,10 @@ def center(self):
self.native.center()

def show(self):
NSApplication.sharedApplication.activate()
if macos_major_version >= 14:
NSApplication.sharedApplication.activate()
else:
NSApplication.sharedApplication.activateIgnoringOtherApps(True)
self.native.makeKeyAndOrderFront(None)

def show_as_sheet(self, window):
Expand Down

0 comments on commit 12adb03

Please sign in to comment.