mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 14:17:12 +02:00
Move applicationDidFinishLaunching code to init
This should make the Qt patch catching the event unneeded
This commit is contained in:
parent
315549b5f8
commit
d2a41a42e0
1 changed files with 8 additions and 7 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue