mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-09-01 15:05:56 +00:00
@@ -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();
|
||||
|
Reference in New Issue
Block a user