mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 14:17:12 +02:00
Fix crash on macOS before the app starts.
This commit is contained in:
parent
eae6e4fc60
commit
dab3bce8ba
1 changed files with 8 additions and 4 deletions
|
@ -156,11 +156,15 @@ ApplicationDelegate *_sharedDelegate = nil;
|
|||
}
|
||||
|
||||
- (BOOL) applicationShouldHandleReopen:(NSApplication *)theApplication hasVisibleWindows:(BOOL)flag {
|
||||
if (const auto window = Core::App().activeWindow()) {
|
||||
if (window->widget()->isHidden()) {
|
||||
window->widget()->showFromTray();
|
||||
Core::Sandbox::Instance().customEnterFromEventLoop([&] {
|
||||
if (Core::IsAppLaunched()) {
|
||||
if (const auto window = Core::App().activeWindow()) {
|
||||
if (window->widget()->isHidden()) {
|
||||
window->widget()->showFromTray();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
return YES;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue