Android: Display orientation was ignored #774

Merged
SakulFlee merged 12 commits from android-orientation into main 2026-09-06 16:43:10 +00:00
Owner
No description provided.
On Android, device rotation triggers suspended→resumed (native window
destroyed/recreated), not WindowEvent::Resized.  The surface and
renderer were recreated with the new portrait dimensions, but the
camera's CameraDescriptorEcs.aspect stayed at the original 16/9 —
causing a projection mismatch that rendered everything black in portrait.

Sync the camera aspect ratio and WindowSize resource in resumed() to
match the freshly-created surface configuration.
Reverts 625468f3 and 37bd65a8 which broke rotation on Android.
The Resized handler and resumed() are back to their original state.
Rotation works again; portrait still shows black (known issue).
The list_devices() parser used split_whitespace().next() to extract the
device serial from 'adb devices' output. WiFi ADB serials like
'adb-d6260ff205bc-htaRwx (3)._adb-tls-connect._tcp' contain spaces,
causing the serial to be truncated and the device to be silently skipped.

Parse the line by scanning for the device state keyword instead, so the
full serial (including spaces) is captured correctly.
The previous fix checked for a space character before the state keyword,
but adb devices uses a tab character to separate the serial from the
state column. This caused WiFi ADB serials (which contain spaces) to
still be silently skipped.

Use is_ascii_whitespace() instead of == b' ' to handle both tabs and
spaces. Also fix the 'no permissions' branch which had the same issue.
Previously defaulted to 'landscape' which locked the activity and
prevented Android from triggering rotation on device tilt.
fix(android): sync camera aspect and depth texture on rotation
Some checks failed
CI / lint (pull_request) Failing after 22s
CI / test (pull_request) Has been skipped
22fbaf5b26
Three fixes for portrait rendering after Android rotation:

1. resumed(): Update CameraDescriptorEcs.aspect and WindowSize
   after the surface is recreated with new dimensions, so the
   projection matrix matches the portrait surface.

2. Resized handler: Call renderer.change_resolution() to recreate
   the depth texture at the new surface dimensions, preventing a
   depth-attachment size mismatch that causes the 3D scene to fail
   silently (black clear color remains while overlays still render).

3. Resized handler: Update camera aspect ratio and mark CameraDirty
   so realize_cameras propagates the new aspect to the GPU buffer.
Merge branch 'main' into android-orientation
Some checks failed
CI / lint (pull_request) Failing after 2m50s
CI / test (pull_request) Has been skipped
48b44e9e19
Sign in to join this conversation.
No description provided.