Fix TextInput.OnInput not firing on Wayland #598
Merged
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.
Bug Description
On Linux using Wayland the TextInput.OnInput event was not firing resulting in the debug console and CelesteNet chat not accepting any input after being opened.
System info
OS: Arch Linux x86_64
Kernel: Linux 6.2.1-arch1-1
WM: sway
Reproduction
~
or.
Fix description
This fix just adds a call to
TextInputEXT.StartTextInput()
on initialization of TextInput.As per TextInputEXT documentation one should call
TextInputEXT.StartTextInput()
before trying to receive events through theTextInputEXT.TextInput
event.A similar bug was reported on the SDL2 repository. These seem correlated as FNA uses SDL2 internally AFAIK.
Considerations
The method
SDL_StartTextInput
seems to intend on opening a virtual keyboard when the platform requires it. This should possibly be checked on Platforms like the SteamDeck or similar. I was not able to produce this behaviour using my system and do not own a SteamDeck.