godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91.24k stars 21.22k forks source link

Green border appears when using usb keyboard on Android #59705

Open Gromph opened 2 years ago

Gromph commented 2 years ago

Godot version

3.4.4, 3.5.beta3

System information

Android 12 Pixel5a

Issue description

I noticed in our game using Godot 3.4.4 and reproduced in the Godot 3.5.beta3 Android Godot editor. That when using the arrow keys on a usb keyboard that a green border will appear around the app.

Basically when a LineEdit has focus the green border goes away, but when anything else has focus it appears.

Steps to reproduce

  1. Download and install on android device: https://downloads.tuxfamily.org/godotengine/3.5/beta3/Godot_v3.5-beta3_android_editor.apk
  2. Plugin usb keyboard. I used a USB A to USB C adapter and a basic dell keyboard
  3. Press arrow keys to navigate around and watch green border appear and disappear

Minimal reproduction project

No response

Gromph commented 2 years ago

I found a potential fix. In platform/android/java/lib/src/org/godotengine/godot/GodotView.java

Add the following line to the top of init: setDefaultFocusHighlightEnabled(false);

Tested and works in our custom build of 3.4.4 but not in 3.5 or 4.0 yet

Calinou commented 2 years ago

For reference, this is caused by the invisible native Android text control that is spawned to make the virtual keyboard work: https://github.com/godotengine/godot/issues/55374

The proposed fix sounds good to me, feel free to open a PR on master :slightly_smiling_face:

By the way, do you know how to fix https://github.com/godotengine/godot/issues/59697 ?