Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frame Advance: Fix UI update spam when continuously advancing. #12784

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

TryTwo
Copy link
Contributor

@TryTwo TryTwo commented May 18, 2024

Holding down frame advance was overloading Qt with update calls, causing issues

Not sure if this is the best method. If there are other times blocking updates would be useful, the names could be made to be more general.

New behavior: Updates calls on first frame advance (for quick 1-frame advances). Blocks all other calls until finished, then reports a new OnStateChanged (paused usually) call.

It could also just do an UpdateDisasmDialog, but things are getting messy with that signal and widgets are more reliable with using OnStateChanged.

@iwubcode
Copy link
Contributor

iwubcode commented May 18, 2024

This means other features will not receive those events as well (they will get 2 events, instead of the number of frame skips that were triggered).

I'd prefer to have the UI ignore those events when the flag is defined.

Source/Core/Core/Core.cpp Outdated Show resolved Hide resolved
@TryTwo
Copy link
Contributor Author

TryTwo commented May 18, 2024

This means other features will not receive those events as well (they will get 2 events, instead of the number of frame skips that were triggered).

I couldn't find anything that requires the massive spam of signals that are produced. AFAIK everything only needs to update when frame advancing is done and not on each frame. In regards to your work, this only affects holding the Frame Advance button and not custom Frame Advance logic.

If there is something that requires those signals I have no problem sorting out the blocking, but I think tons of widgets are hit and none of them need the signals.

@iwubcode
Copy link
Contributor

iwubcode commented May 19, 2024

In regards to your work, this only affects holding the Frame Advance button and not custom Frame Advance logic.

My work was the first thing I thought of. Not sure what you mean by 'custom frame advance logic'? It still uses the frame advance hotkey or ui button. I can wrap your change in a check but just in general it seems odd to me to block all the callbacks, when you're trying to solve this for the UI.

I can work around it but wanted to mention it in case others share my concern.

@TryTwo
Copy link
Contributor Author

TryTwo commented May 19, 2024

Sorry, I haven't seen all your code so I may have misunderstood. I thought you directly called DoFrameStep() and didn't need the Hotkey for anything special.

Please correct me if I'm wrong, but I think as of now EmulationStateChanged signals and callbacks only affect UI/Debug stuff. If that's correct, I think handling your usage as a special outlier is simpler.

…en. Blocks signals from being spammed to update the UI.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants