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:
@@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user