2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

Fix crash in event loop nesting.

This commit is contained in:
John Preston
2019-04-07 10:59:37 +04:00
parent a0926f2d70
commit 6c17ed2242
3 changed files with 14 additions and 6 deletions

View File

@@ -9,6 +9,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "mainwindow.h"
#include "mainwidget.h"
#include "core/sandbox.h"
#include "core/application.h"
#include "core/crash_reports.h"
#include "storage/localstorage.h"
@@ -184,9 +185,11 @@ ApplicationDelegate *_sharedDelegate = nil;
}
- (void) mediaKeyTap:(SPMediaKeyTap*)keyTap receivedMediaKeyEvent:(NSEvent*)e {
if (e && [e type] == NSSystemDefined && [e subtype] == SPSystemDefinedEventMediaKeys) {
objc_handleMediaKeyEvent(e);
}
Core::Sandbox::Instance().customEnterFromEventLoop([&] {
if (e && [e type] == NSSystemDefined && [e subtype] == SPSystemDefinedEventMediaKeys) {
objc_handleMediaKeyEvent(e);
}
});
}
- (void) ignoreApplicationActivationRightNow {