Skip to content

Commit

Permalink
Support the updated macOS 14.0 window activation API
Browse files Browse the repository at this point in the history
  • Loading branch information
newmarcel committed Mar 30, 2024
1 parent 9bd45a4 commit a037416
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions KeepingYouAwake/KYAAppController/KYAAppDelegate.m
Expand Up @@ -12,7 +12,7 @@
#import "KYASettingsWindow.h"
#import "KYAUpdateSettingsViewController.h"

@interface KYAAppDelegate () <NSWindowDelegate>
@interface KYAAppDelegate ()
@property (weak, nonatomic, nullable) KYASettingsWindow *settingsWindow;
@end

Expand All @@ -34,7 +34,14 @@ - (void)applicationDidFinishLaunching:(NSNotification *)notification

- (void)showSettingsWindow:(id)sender
{
[NSApplication.sharedApplication activateIgnoringOtherApps:YES];
if(@available(macOS 14.0, *))
{
[NSApplication.sharedApplication activate];
}
else
{
[NSApplication.sharedApplication activateIgnoringOtherApps:YES];
}

AutoVar settingsWindow = self.settingsWindow;
if(settingsWindow == nil)
Expand Down

0 comments on commit a037416

Please sign in to comment.