Skip to content

Conversation

@Cyannide
Copy link

@Cyannide Cyannide commented Nov 4, 2025

Launching a fragment with an EditText widget on top of an AGDK view and bringing up the soft keyboard generates the event and hits the unreachable! at the end of the match statement.

@rib
Copy link
Member

rib commented Jan 7, 2026

Instead of exposing a VisibilityChanged event publicly, my current preference here is to patch the GameActivity backend to never send the (unused) APP_CMD_SOFTWARE_KB_VIS_CHANGED event.

This is what I recently did while looking at enabling IME in winit:
rust-mobile/android-games-sdk@518da96

My rough reasoning here is that:

  • This visibility changed status is only supported by the GameActivity backend
  • The implementation is based on a insets heuristic that may not be reliable (e.g. with floating keyboards or physical keyboards, or multiple displays)

From an application point of view it would probably be a trap / mistake to try and trust this visibility state because it would probably mean you're overlooking the possibility that someone has a physical keyboard / floating keyboard.

Android doesn't provide a reliable way of tracking soft keyboard visibility and applications should likely re-assert the visibility they want when they start/stop text input (e.g. every time you tap a text input field you request to show the keyboard, regardless of what you know about its current visibility).

@Cyannide
Copy link
Author

Cyannide commented Jan 7, 2026

That sounds good to me. Should I just close this PR?

@rib
Copy link
Member

rib commented Jan 7, 2026

No worries - I'll look at opening PRs for the APP_CMD_SOFTWARE_KB_VIS_CHANGED change I made + exposing editor actions and can close this in the process of merging the other change if we're still agreed that there's no pressing use case for exposing a VisibilityChanged event.

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