From 59942531dfeafcf92b8b7083d2e169d63bbfe68d Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Sun, 23 Oct 2016 19:57:43 +0800 Subject: [PATCH 1/2] Fix crash when restoring from tray. Closes #5854. --- src/gui/mainwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index e881e02ce..049c6911d 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -920,7 +920,7 @@ void MainWindow::toggleVisibility(QSystemTrayIcon::ActivationReason e) return; } // Make sure the window is not minimized - setWindowState(windowState() & (~Qt::WindowMinimized | Qt::WindowActive)); + setWindowState((windowState() & ~Qt::WindowMinimized) | Qt::WindowActive); // Then show it show(); raise(); From c49bb2daad18ac9cc1bb60fce9e3528a1f3b720d Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Sun, 23 Oct 2016 20:04:40 +0800 Subject: [PATCH 2/2] The intended action is set the bit to 1, not flipping it. --- src/gui/mainwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index 049c6911d..8afefdfcd 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -1600,7 +1600,7 @@ void MainWindow::showConnectionSettings() void MainWindow::minimizeWindow() { - setWindowState(windowState() ^ Qt::WindowMinimized); + setWindowState(windowState() | Qt::WindowMinimized); } void MainWindow::on_actionExecutionLogs_triggered(bool checked)