1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

Fix behavior when clicking on the tray icon

This commit is contained in:
Anatoliy Zinovyev 2015-11-21 20:51:43 -05:00
parent 0ef39aa06a
commit fc462e82df

View File

@ -738,31 +738,23 @@ void Widget::onIconClick(QSystemTrayIcon::ActivationReason reason)
{
case QSystemTrayIcon::Trigger:
{
if (isHidden())
if (isHidden() || isMinimized())
{
show();
activateWindow();
if (wasMaximized)
showMaximized();
else
showNormal();
activateWindow();
}
else if (isMinimized())
else if (!isActiveWindow())
{
forceShow();
activateWindow();
if (wasMaximized)
showMaximized();
else
showNormal();
}
else
{
wasMaximized = isMaximized();
if (Settings::getInstance().getMinimizeToTray())
hide();
else
showMinimized();
hide();
}
break;