Skip to content

Commit

Permalink
macOS: Fix runtime warning about window ordering on launch
Browse files Browse the repository at this point in the history
  • Loading branch information
brackeen committed Jan 5, 2024
1 parent b71b24d commit 64f58ac
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/glfm_apple.m
Original file line number Diff line number Diff line change
Expand Up @@ -2795,11 +2795,13 @@ - (void)applicationDidFinishLaunching:(NSNotification *)notification {
[glfmViewController.glfmViewIfLoaded draw];

if (NSApp.activationPolicy == NSApplicationActivationPolicyRegular) {
[self.window makeKeyAndOrderFront:nil];
[self.window makeKeyWindow];
[self.window orderFrontRegardless];
} else {
// Executable-only (unbundled) app
[NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
[self.window makeKeyAndOrderFront:nil];
[self.window makeKeyWindow];
[self.window orderFrontRegardless];
[NSApp activateIgnoringOtherApps:YES];
}
}
Expand Down

0 comments on commit 64f58ac

Please sign in to comment.