Skip to content

Merge android-host-insets: safe-area and keyboard insets on the host path - #9

Merged
Bombatomica64 merged 2 commits into
mainfrom
lab-host-insets
Oct 12, 2026
Merged

Bombatomica64 merged 2 commits into
mainfrom
lab-host-insets

Conversation

@Bombatomica64

@Bombatomica64 Bombatomica64 commented Oct 10, 2026 •

Copy link
Copy Markdown
Owner

Merges android-host-insets (based on upstream main, the branch to propose upstream) into fork main, so the lab can pin it.

  • host::insets_changed(host, SafeAreaInsets, ime): the host reports the system bars, cutout and keyboard in physical px. The render thread stores them on that host's window, or keeps them until the window opens.
  • AndroidPlatformWindow implements GPUI's insets() / on_insets_changed, so Window::fully_visible_bounds() works and GPUI refreshes on change.
  • gpui_mobile::safe_area_insets() and keyboard_height() return them too, as on iOS.

The only conflict was in host.rs, next to configuration_changed (longbridge#30 here); I kept both sides.

Lab: Bombatomica64/Gpui-android#63.

🤖 Generated with Claude Code

The host path had no way to pass insets in, so a host that draws behind the
system bars could not tell GPUI where they are, and the Android window
returned GPUI's default (zero) `PlatformWindow::insets`. `host::insets_changed`
takes the bars and cutout as `SafeAreaInsets` plus the keyboard height, in
physical pixels, and the render thread stores them on that host's window (or
keeps them until the window opens).

The window now implements `insets()` and `on_insets_changed`, so apps get the
values through GPUI (`Window::fully_visible_bounds`) and GPUI refreshes the
window when they change. `safe_area_insets()` and `keyboard_height()` return
them too, as on iOS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	src/android/host.rs
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.

1 participant