Fix unexpected mute when window becomes focused while fast-forwarding #3644
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Reported by user "Vapoure" in Discord.
Steps to reproduce
Expected results
There should be no audio interruptions, because none of the Pause or Mute options are turned on.
Actual results
The audio becomes muted when the window regains focus.
Additional details
It turns out that there's a difference between the default behavior of the Fast Forward Mute option and the "off" behavior -- this issue cannot be reproduced if the
fastForwardMuteline inconfig.inidoes not exist. I'm not sure of the historical background for why this option's unconfigured behavior would be expected to differ from either the checked or unchecked behavior, but the logic for working with the -1 value is clearly mistaken.I also separated the "inactive" and "minimized" boolean flags because there's a potential edge case that the window could receive a
showEventwithout gaining the focus, which would result in unexpected behavior. (This is possible with some window managers.)