gamescope's display is sized once when the session starts and cannot change,
but the size was recomputed on every surfaceCreated. A foldable recreates the
Surface on the other panel, so a session started on the 21:9 outer screen and
opened onto the square inner one told the compositor its 21:9 buffer was 16:9
and the picture came back squashed sideways. While a session runs its size is
kept; the compositor letterboxes it onto whatever panel is current.
Also the Compose build: BoxWithConstraints' maxWidth read outside its scope.
The main screen, the loading overlay, the HUD line, the drawer and the three
dialogs are composables now, driven by state the activities own. The session's
SurfaceView and the on-screen pad stay Views underneath a single Compose layer,
which is what they are in any Compose app: a compositor surface and a canvas,
not menus. The XML layouts are gone; the activities extend ComponentActivity
and Back goes through its dispatcher.