Skip to content

Commit

Permalink
Merge pull request #977 from Chilledheart/mac_bring_to_front_on_start…
Browse files Browse the repository at this point in the history
…up_recover

mac: bring to front on startup/recover
  • Loading branch information
Chilledheart committed May 25, 2024
2 parents 6359947 + 9e270fd commit ec09a5b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/mac/Info.plist.in
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,6 @@
<key>NSSupportsSuddenTermination</key>
<false/>
<key>LSBackgroundOnly</key>
<true/>
<false/>
</dict>
</plist>
5 changes: 4 additions & 1 deletion src/mac/YassAppDelegate.mm
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ - (void)applicationDidFinishLaunching:(NSNotification*)aNotification {
}

SetDockIconStyle(false);
[NSApp activateIgnoringOtherApps:true];

if (![NSApp isActive]) {
[NSApp activateIgnoringOtherApps:YES];
}
}

- (void)applicationWillTerminate:(NSNotification*)aNotification {
Expand Down
4 changes: 4 additions & 0 deletions src/mac/YassWindowController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ - (void)statusItemClicked {
NSWindow* window = self.window;
[window performSelector:@selector(orderFrontRegardless) withObject:nil afterDelay:0.10];
[window makeKeyAndOrderFront:nil];

if (![NSApp isActive]) {
[NSApp activateIgnoringOtherApps:YES];
}
}

- (void)UpdateStatusBar {
Expand Down

0 comments on commit ec09a5b

Please sign in to comment.