Trigger deactivate event for virtual gamepad #7711
Open
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.
This PR resolves an issue reported by Discord user Ensl:
Prior to #7513, the loading screens would call
FetchMessage()
ininterface_msg_pump()
to process events whenever the loading bar updates.FetchMessage()
would delegate the event to the virtual gamepad event handler, meaning thatSDL_FINGERUP
events that occur during the loading screen would still be handled.Now, with the async loading implementation, we are explicitly bypassing
FetchMessage()
and callingSDL_PollEvent()
directly. This means the virtual gamepad event handlers aren't handling those finger up events.devilutionX/Source/interfac.cpp
Lines 686 to 688 in a3eea0f
Rather than relying on the user to remove their finger from the screen during the loading sequence, I figured it would make more sense to go ahead and reset the event handler state the same way we do for d-pad and button state when calling
DeactivateVirtualGamepad()
.