Qt: Disable held-rewind when a window loses focus

This commit is contained in:
Jeffrey Pfau 2015-06-11 01:27:51 -07:00
parent 5213b8a1fe
commit 4ba576ef87
2 changed files with 4 additions and 0 deletions

View File

@ -479,6 +479,9 @@ void GameController::startRewinding() {
} }
void GameController::stopRewinding() { void GameController::stopRewinding() {
if (!m_rewindTimer.isActive()) {
return;
}
m_rewindTimer.stop(); m_rewindTimer.stop();
setPaused(m_wasPaused); setPaused(m_wasPaused);
} }

View File

@ -406,6 +406,7 @@ void Window::closeEvent(QCloseEvent* event) {
void Window::focusOutEvent(QFocusEvent*) { void Window::focusOutEvent(QFocusEvent*) {
m_controller->setTurbo(false, false); m_controller->setTurbo(false, false);
m_controller->stopRewinding();
m_controller->clearKeys(); m_controller->clearKeys();
} }