Attempt more fixes for waiting state

This commit is contained in:
Cacodemon345
2025-07-12 15:33:56 +06:00
parent b11c5af060
commit 270fbad0ba
3 changed files with 5 additions and 2 deletions

View File

@@ -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<VMManagerProtocol::RunningState>(dopause));
emit vmmRunningStateChanged(static_cast<VMManagerProtocol::RunningState>(window_blocked ? (dopause ? VMManagerProtocol::RunningState::PausedWaiting : VMManagerProtocol::RunningState::RunningWaiting) : (VMManagerProtocol::RunningState)dopause));
}
void

View File

@@ -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

View File

@@ -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);