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>
This commit is contained in:
jefrecantuledesma
2025-12-15 20:42:35 -05:00
committed by GitHub
parent 0ffcfe3bff
commit ec8efde28a

View File

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