app/internal/wm: [macOS] make app emnu responsive on launch

The macOS app menu would respond to clicks, only to shotcuts (Cmd-Q,
Cmd-H). Moving setActivationPolicy to applicationDidFinishLaunching
seems to fix that, although I can't explain why.

Move a SetDriver call after initialization while here.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2021-06-14 23:16:41 +02:00
parent e256d52409
commit 4c8aa4c3ca
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -316,7 +316,8 @@ CFTypeRef gio_createView(void) {
@implementation GioAppDelegate
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
[[NSRunningApplication currentApplication] activateWithOptions:(NSApplicationActivateAllWindows | NSApplicationActivateIgnoringOtherApps)];
[NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
[NSApp activateIgnoringOtherApps:YES];
gio_onFinishLaunching();
}
- (void)applicationDidHide:(NSNotification *)aNotification {
@@ -332,7 +333,6 @@ void gio_main() {
[NSApplication sharedApplication];
GioAppDelegate *del = [[GioAppDelegate alloc] init];
[NSApp setDelegate:del];
[NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
NSMenuItem *mainMenu = [NSMenuItem new];