2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Fix crash with event loop nesting tracking.

This commit is contained in:
John Preston
2019-04-12 17:21:01 +04:00
parent cc8f4aa24f
commit 7cfb122dea
7 changed files with 27 additions and 13 deletions

View File

@@ -16,6 +16,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "boxes/confirm_box.h"
#include "core/click_handler_types.h"
#include "core/application.h"
#include "core/sandbox.h"
#include "lang/lang_keys.h"
#include "data/data_session.h"
#include "auth_session.h"
@@ -406,6 +407,17 @@ void MainWindow::setPositionInited() {
_positionInited = true;
}
void MainWindow::attachToTrayIcon(not_null<QSystemTrayIcon*> icon) {
icon->setToolTip(str_const_toString(AppName));
connect(icon, &QSystemTrayIcon::activated, this, [=](
QSystemTrayIcon::ActivationReason reason) {
Core::Sandbox::Instance().customEnterFromEventLoop([&] {
handleTrayIconActication(reason);
});
});
App::wnd()->updateTrayMenu();
}
void MainWindow::resizeEvent(QResizeEvent *e) {
updateControlsGeometry();
}