diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2016-08-14 15:20:11 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2016-08-14 15:20:11 +0200 |
commit | 1577bef63662b9fec3fb7b8a2e31a544a2d76e1e (patch) | |
tree | 87c830bf1b245a7559d850340a4554f9b8df2f64 /gui/main-window.cpp | |
parent | cbe3a26c92cc7e2269a2c2a5ab092870a964afb4 (diff) |
gui: fix main window restored from tray being minimized
Reported-by: @albertolg
Issue: #410
Diffstat (limited to 'gui/main-window.cpp')
-rw-r--r-- | gui/main-window.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/gui/main-window.cpp b/gui/main-window.cpp index 70652201..7915be20 100644 --- a/gui/main-window.cpp +++ b/gui/main-window.cpp @@ -659,8 +659,13 @@ void MainWindow::toggle_restore_from_tray(QSystemTrayIcon::ActivationReason e) setVisible(is_minimized); setHidden(!is_minimized); - if (!is_minimized) - setWindowState(Qt::WindowNoState); + setWindowState(progn( + using ws = Qt::WindowStates; + if (is_minimized) + return ws(windowState() & (~Qt::WindowMinimized)); + else + return ws(Qt::WindowNoState); + )); if (is_minimized) { |