2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-30 22:25:12 +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

@@ -11,6 +11,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "mainwidget.h"
#include "history/history_widget.h"
#include "core/crash_reports.h"
#include "core/sandbox.h"
#include "storage/localstorage.h"
#include "mainwindow.h"
#include "history/history_location_manager.h"
@@ -38,10 +39,12 @@ public:
}
bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) {
auto wnd = App::wnd();
if (!wnd) return false;
return Core::Sandbox::Instance().customEnterFromEventLoop([&] {
auto wnd = App::wnd();
if (!wnd) return false;
return wnd->psFilterNativeEvent(message);
return wnd->psFilterNativeEvent(message);
});
}
};

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 {