mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-03-01 12:00:48 +00:00
parent
e6c0f0f774
commit
8c3b7f6417
@ -779,15 +779,22 @@ void MainWindow::toggleTray(QSystemTrayIcon::ActivationReason reason) {
|
||||
if (reason == QSystemTrayIcon::Context) {
|
||||
updateTrayMenu(true);
|
||||
QTimer::singleShot(1, this, SLOT(psShowTrayMenu()));
|
||||
} else {
|
||||
} else if (!skipTrayClick()) {
|
||||
if (isActive()) {
|
||||
minimizeToTray();
|
||||
} else {
|
||||
showFromTray(reason);
|
||||
}
|
||||
_lastTrayClickTime = getms();
|
||||
}
|
||||
}
|
||||
|
||||
bool MainWindow::skipTrayClick() const {
|
||||
return (_lastTrayClickTime > 0)
|
||||
&& (getms() - _lastTrayClickTime
|
||||
< QApplication::doubleClickInterval());
|
||||
}
|
||||
|
||||
void MainWindow::toggleDisplayNotifyFromTray() {
|
||||
if (App::passcoded()) {
|
||||
if (!isActive()) showFromTray();
|
||||
|
@ -177,6 +177,8 @@ private:
|
||||
void showConnecting(const QString &text, const QString &reconnect = QString());
|
||||
void hideConnecting();
|
||||
|
||||
[[nodiscard]] bool skipTrayClick() const;
|
||||
|
||||
void ensureLayerCreated();
|
||||
void destroyLayerDelayed();
|
||||
|
||||
@ -196,6 +198,7 @@ private:
|
||||
};
|
||||
QList<DelayedServiceMsg> _delayedServiceMsgs;
|
||||
mtpRequestId _serviceHistoryRequest = 0;
|
||||
TimeMs _lastTrayClickTime = 0;
|
||||
|
||||
object_ptr<PasscodeWidget> _passcode = { nullptr };
|
||||
object_ptr<Intro::Widget> _intro = { nullptr };
|
||||
|
Loading…
Reference in New Issue
Block a user