Attempt more fixes for waiting state
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user