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

Fix TextInput.OnInput not firing on Wayland #598

Merged
merged 2 commits into from
Jun 1, 2023

Conversation

GaimeWolves
Copy link
Contributor

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

  1. Run Celeste with Everest loaded
  2. Open debug console using ~ or .
  3. Try typing in the console

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 the TextInputEXT.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.

Platforms like Wayland require calling TextInputEXT.StartTextInput()
before any events are fired. With the addition, input on the debug
console and CelestNet chat will work under Wayland, whereas before both
accepted no input after being opened.
@GaimeWolves GaimeWolves force-pushed the bugfix-textinput-wayland branch from 25ac1d9 to 3264aab Compare March 14, 2023 21:38
@DemoJameson DemoJameson requested a review from Popax21 May 11, 2023 08:18
Copy link
Member

@Popax21 Popax21 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, however according to the docs there is also a StopTextInput method. I suggest you call that during the game's shutdown procedure as well.

Celeste.Mod.mm/Mod/Everest/TextInput.cs Outdated Show resolved Hide resolved
@GaimeWolves GaimeWolves requested a review from Popax21 May 13, 2023 07:10
@Popax21 Popax21 merged commit fdc6ddb into EverestAPI:dev Jun 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants