diff options
author | Hannah von Reth <hannah.vonreth@owncloud.com> | 2021-11-17 13:17:58 +0300 |
---|---|---|
committer | Hannah von Reth <hannah.vonreth@owncloud.com> | 2021-11-17 17:11:11 +0300 |
commit | 53c1ead1d53bfc8d6ae07c5c67053a1797e64f8e (patch) | |
tree | a4bc48567c1da0f269a9092890aa4e8c57a69fff /src/gui/settingsdialog.cpp | |
parent | cfb5ed05bebc186c009cdffd6f71c71f0a1cfb08 (diff) |
Create our own message loop to receive WM_ENDSESSION
This ensures we receive the message even if no window is shown
(cherry picked from commit 36311b00be41b1edbe46791f1c44d11f8584c4f8)
Diffstat (limited to 'src/gui/settingsdialog.cpp')
-rw-r--r-- | src/gui/settingsdialog.cpp | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/src/gui/settingsdialog.cpp b/src/gui/settingsdialog.cpp index 1b72e2c18..01ebffc9b 100644 --- a/src/gui/settingsdialog.cpp +++ b/src/gui/settingsdialog.cpp @@ -326,23 +326,6 @@ void SettingsDialog::setVisible(bool visible) QMainWindow::setVisible(visible); } -#if defined(Q_OS_WIN) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - -bool SettingsDialog::nativeEvent(const QByteArray &eventType, void *message, long *result) -{ - auto msg = reinterpret_cast<MSG *>(message); - // https://github.com/owncloud/client/issues/8979 - // Qt5 has a bug that Windows already get closed on WM_QUERYENDSESSION - // so they never receive WM_ENDSESSION - // Capture the event and go down in style - if (msg->message == WM_QUERYENDSESSION || msg->message == WM_ENDSESSION) { - qCInfo(lcApplication) << "Shutting down" << *msg; - QTimer::singleShot(0, ocApp(), Application::quit); - } - return false; -} -#endif - void SettingsDialog::slotSwitchPage(QAction *action) { _ui->stack->setCurrentWidget(_actionGroupWidgets.value(action)); |