godotengine / godotengine/godot

Mac Safari accent-picking window can still be visible after hiding an edited LineEdit

Open
#97,251 0 comments 0 reactions 0 assignees View on GitHub
bug platform:macos topic:input topic:platforms
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

### Tested versions

- Reproducible in v4.3.stable.official [77dcf97d8]

### System information

Godot v4.3.stable - macOS 14.6.1 - GLES3 (Compatibility) - Apple M2 Pro - Apple M2 Pro (10 Threads)

### Issue description

It is possible to open the Mac accent menu by pressing and holding a key like A, E, etc while editing text. If you edit text in a LineEdit, and then hide that LineEdit (`.visible = false`) and hold down A, E despite not being focused on any control, the Mac accent window will pop up again.

Screenshot 2024-09-20 at 3 21 46 PM

This is noticeable with games that are using WASD for controls. It only seems to affect the web exported version of the project; macOS desktop does not seem to have the issue.

`gui_get_focus_owner()` reports that there is a null focus when this is happening.

Our current workaround is to make the scene root "`grab_focus()`" – this seems to trick the system into believing text input is no longer happening.

Thank you for your time!

### Steps to reproduce

1. Click on a `LineEdit` control and type anything. You do not have to hold down an accent key.
2. Hide the `LineEdit` control, e.g. by clicking the hide/show button in the example project.
3. Hold down A, E, etc and watch the menu appear even though you are not editing text.

Web version can be tested here: https://clinquant-biscotti-90bb69.netlify.app/

### Minimal reproduction project (MRP)

Web version can be tested here: https://clinquant-biscotti-90bb69.netlify.app/

[text_edit_web_bug_repro.zip](https://github.com/user-attachments/files/17080923/text_edit_web_bug_repro.zip)

Contributor guide

Open the contributing guide

Research direction

Start with the linked minimal reproduction project and reproduce the behavior in the web export after hiding the LineEdit. Then trace the focus and text-input state reported by gui_get_focus_owner() during LineEdit editing and hiding. Done means the Mac accent window no longer reappears after the edited control is hidden and focus is null.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
frontend, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.