Move applicationDidFinishLaunching code to init

This should make the Qt patch catching the event unneeded
This commit is contained in:
Ilya Fedin 2021-09-29 08:35:47 +04:00 committed by John Preston
parent 315549b5f8
commit d2a41a42e0
1 changed files with 8 additions and 7 deletions

View File

@ -147,6 +147,14 @@ ApplicationDelegate *_sharedDelegate = nil;
base::Timer _ignoreActivationStop;
}
- (instancetype) init: {
_ignoreActivation = false;
_ignoreActivationStop.setCallback([self] {
_ignoreActivation = false;
});
return [super init];
}
- (BOOL) applicationShouldHandleReopen:(NSApplication *)theApplication hasVisibleWindows:(BOOL)flag {
if (const auto window = Core::App().activeWindow()) {
if (window->widget()->isHidden()) {
@ -156,13 +164,6 @@ ApplicationDelegate *_sharedDelegate = nil;
return YES;
}
- (void) applicationDidFinishLaunching:(NSNotification *)aNotification {
_ignoreActivation = false;
_ignoreActivationStop.setCallback([self] {
_ignoreActivation = false;
});
}
- (void) applicationDidBecomeActive:(NSNotification *)aNotification {
Core::Sandbox::Instance().customEnterFromEventLoop([&] {
if (Core::IsAppLaunched() && !_ignoreActivation) {