Repository navigation
Conversation
ShuffleEnabled(bool) only set the flag on the projectM playlist, but Next(), Previous() and Random() restore the flag from _shuffle after temporarily changing it. _shuffle was never set, so shuffle got turned off after the first N, P or R key press.
Ctrl/Cmd+M (move to next display) also opened the preset chooser.
PresetPlaylist::CurrentIndex() throws PlaylistEmptyException if the playlist is empty, so pressing M without any presets loaded crashed the application. Show a toast instead.
While no UI is shown, ProjectMGUI::Draw() returns before ImGui::NewFrame(), but SDL events are still forwarded to ImGui via ProcessInput(). They pile up in ImGui's input queue and are replayed (trickled over several frames) once the UI becomes active again, e.g. when opening the preset chooser: - Letters typed earlier (r for random preset etc.) end up in the search field. - An earlier ESC or Enter press closes the chooser right after opening it, so M seems to do nothing. Clear the event queue and the key/mouse state when the UI becomes active after an idle period.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Hi! I've been using the preset search window from projectM-visualizer#139 in my own build and ran into a few issues, including the key buffer problem mentioned in the PR description. These are small fixes on top of your branch, one commit each, in case they're useful. Feel free to cherry-pick, change or ignore any of them.
Fixes
PresetPlaylist::ShuffleEnabled(bool)never updated_shuffle, butNext(),Previous()andRandom()restore the projectM playlist's shuffle flag from it. The setter now keeps_shufflein sync (and is no longerconst).PresetPlaylist::CurrentIndex()throwsPlaylistEmptyException, so a "No presets loaded" toast is shown instead.ProjectMGUI::Draw()returns beforeImGui::NewFrame(), but SDL events are still passed to ImGui. They pile up in ImGui's input queue and are replayed (trickled over several frames) once the UI becomes active. Old letters end up in the search field, and an earlier ESC or Enter closes the chooser right after it opens. The fix clears the event queue and key/mouse state (ClearEventsQueue(),ClearInputKeys(),ClearInputMouse()) when the UI becomes active after being idle.Tested on Windows 11 (MSVC, Release build).
🤖 Generated with Claude Code