diff --git a/src/qt/qt_mainwindow.cpp b/src/qt/qt_mainwindow.cpp index 6f87c3ce0..861037f99 100644 --- a/src/qt/qt_mainwindow.cpp +++ b/src/qt/qt_mainwindow.cpp @@ -1454,11 +1454,13 @@ MainWindow::eventFilter(QObject *receiver, QEvent *event) if (receiver == this) { static auto curdopause = dopause; if (event->type() == QEvent::WindowBlocked) { + window_blocked = true; curdopause = dopause; plat_pause(isShowMessage ? 2 : 1); emit setMouseCapture(false); releaseKeyboard(); } else if (event->type() == QEvent::WindowUnblocked) { + window_blocked = false; plat_pause(curdopause); } } @@ -2112,7 +2114,7 @@ MainWindow::updateUiPauseState() QString(tr("Pause execution")); ui->actionPause->setIcon(pause_icon); ui->actionPause->setToolTip(tooltip_text); - emit vmmRunningStateChanged(static_cast(dopause)); + emit vmmRunningStateChanged(static_cast(window_blocked ? (dopause ? VMManagerProtocol::RunningState::PausedWaiting : VMManagerProtocol::RunningState::RunningWaiting) : (VMManagerProtocol::RunningState)dopause)); } void diff --git a/src/qt/qt_mainwindow.hpp b/src/qt/qt_mainwindow.hpp index 54a04a975..370d97d0e 100644 --- a/src/qt/qt_mainwindow.hpp +++ b/src/qt/qt_mainwindow.hpp @@ -200,6 +200,7 @@ private: QIcon caps_icon_off, scroll_icon_off, num_icon_off, kana_icon_off; bool isShowMessage = false; + bool window_blocked = false; }; #endif // QT_MAINWINDOW_HPP diff --git a/src/qt/qt_vmmanager_clientsocket.hpp b/src/qt/qt_vmmanager_clientsocket.hpp index a05e5bfae..980ec10ee 100644 --- a/src/qt/qt_vmmanager_clientsocket.hpp +++ b/src/qt/qt_vmmanager_clientsocket.hpp @@ -49,7 +49,7 @@ private: QString server_name; QLocalSocket *socket; bool server_connected; - bool window_blocked; + bool window_blocked = false; void connected() const; void disconnected() const; static void connectionError(QLocalSocket::LocalSocketError socketError);