Fix blank window when restoring from systray (#6351)

* Fix blank window when restoring from systray

This applies the fix qBittorrent used for this same issue:
https://github.com/qbittorrent/qBittorrent/issues/9240,
so credit goes to those guys

* Fix whitespace
This commit is contained in:
lordlethis 2019-07-13 13:57:27 +02:00 committed by John Maguire
parent 9af827b6ac
commit c9800a4dc9
1 changed files with 2 additions and 2 deletions

View File

@ -1441,7 +1441,7 @@ void MainWindow::closeEvent(QCloseEvent* event) {
keep_running = s.value("keeprunning", tray_icon_->IsVisible()).toBool();
if (keep_running && event->spontaneous()) {
event->accept();
event->ignore();
SetHiddenInTray(true);
} else {
Exit();
@ -1454,7 +1454,7 @@ void MainWindow::SetHiddenInTray(bool hidden) {
// Some window managers don't remember maximized state between calls to
// hide() and show(), so we have to remember it ourself.
if (hidden) {
hide();
QTimer::singleShot(0, this, &QWidget::hide);
} else {
if (was_maximized_)
showMaximized();