mojira.dev
MC-310213

On-screen keyboard handling is inconsistent

I’ve incorrect usage of SDL where TextInputManager.startTextInput calls SDL_StartTextInput with a window handle using outdated window->text_input_rect and only afterwards is it corrected by a call to TextInputManager.setTextInputArea.

This is a race condition wherein someone calling SDL_GetTextInputArea can get the incorrect value set by SDL_StartTextInput before Minecraft calls SDL_SetTextInputArea to correct it. So SDL_StartTextInput should still be called with the proper value set beforehand.

Additionally, SDL_SetTextInputArea is needlessly spam called while a text box is open, even if its location isn’t changing
Additionally additionally, if touch keyboards are not to be supported, the SDL hint SDL_HINT_ENABLE_SCREEN_KEYBOARD should be set to 0 as this incorrect usage leads to very odd behavior in linux, and windows not having the keyboard appear at all.

Comments 2

We do not have enough information to reproduce this issue.

Please include the following information to help us understand your problem:

Steps to reproduce:
1. (Explain what needs to be done for the issue to happen.)
2.
3.

Expected results:
(Briefly describe what should happen.)

Observed results:
(Briefly describe what actually happens.)

If any commands are needed, please include them. If any data packs, resource packs, or worlds are needed, please attach them to this report, or provide a download link to them if they are too large.
Please also attach any screenshots or videos that might be helpful in explaining or visualizing the issue.

Please refer to the Bug Tracker Guidelines for more information about how to write helpful bug reports. Bug reports with insufficient information may be closed as Incomplete.

This issue is being temporarily resolved as Awaiting Response. Once the requested information has been delivered, the report will be reopened automatically.

Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki

Reproduction steps on Linux:
1) Use KDE Plasma (Wayland)
2) Enable the on-screen virtual keyboard plasma-keyboard
3) Tap the chat box, that is that black area in which chat text is displayed

Reproduction steps on Windows 11:
1) Set on-screen keyboard to always appear
2) Tap the chat box

Observed results:
Linux: On-screen keyboard is triggered and appears, obscuring half the screen without any proper resizing/rescaling being done to adapt to it
Windows: On-screen keyboard does not appear

Expected results:
Linux to match Windows 11 results, that is, no on-screen keyboard appears

Additional Information:
I added specifically the cause as to how the implementation of the on-screen keyboard is broken and may possibly cause issues down the line. I noted down two things that should be fixed with the SDL implementation of text input and how.
1) SDL_HINT_ENABLE_SCREEN_KEYBOARD hint is not set before SDL subsystem init
2) Arguments used for calls to SDL_StartTextInput is outdated

alexytomi

electfall

Plausible

Platform HC

Normal

Input

26.3 Snapshot 4

26.3 Snapshot 6

Retrieved