From ec8efde28af84d85b045b0624f04460f066e880f Mon Sep 17 00:00:00 2001 From: jefrecantuledesma <98501869+jefrecantuledesma@users.noreply.github.com> Date: Mon, 15 Dec 2025 20:42:35 -0500 Subject: [PATCH] Fix Shift+Space corrupting playback state when used on stopped editors (#8154) * Fix Shift+Space corrupting playback state when used on stopped editors Shift+Space (togglePause) was allowing state corruption by modifying m_playing and m_paused without checking m_playMode. This created an impossible state where m_playing=true while m_playMode=None, causing the regular Space key to stop working. Added a guard to ensure togglePause() only operates when something is actually playing (m_playMode != PlayMode::None). This prevents the corrupted state and maintains proper play/pause/stop behavior. Fixes #8036 --------- Co-authored-by: regulus79 <117475203+regulus79@users.noreply.github.com> --- src/core/Song.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/core/Song.cpp b/src/core/Song.cpp index 4de614d1c..306647b6b 100644 --- a/src/core/Song.cpp +++ b/src/core/Song.cpp @@ -625,6 +625,12 @@ void Song::setPlayPos( tick_t ticks, PlayMode playMode ) void Song::togglePause() { + // Pause/unpause only works when something is actually playing + if (m_playMode == PlayMode::None) + { + return; + } + if( m_paused == true ) { m_playing = true;