Skip to content

Simulator: iPhone 7, turning the device, keyboard stays on the guest - #186

Merged
henrikklee merged 3 commits into
mainfrom
simulator-rotation-and-phone
Nov 19, 2026
Merged

henrikklee merged 3 commits into
mainfrom
simulator-rotation-and-phone

Conversation

@henrikklee

Copy link
Copy Markdown
Contributor

Makes the Orchard Simulator show what a desktop change looks like on a phone and in landscape, without hardware.

  • iPhone 7 next to the iPad 6 (Device menu, or simulator/vm device iphone7): its own realistic frame (Home button, earpiece, side buttons) and its 750×1334 panel; the VM keeps the choice across restarts.
  • Turning the device: Rotate Left and Rotate Right (⌃⌘← / ⌃⌘→) turn the whole frame. A small VM-only accelerometer driver (orchard-vm-accel) reports the gravity the turned device would feel, so the desktop rotates through iio-sensor-proxy and its own rotation path, the same as on a tablet. Nothing in the product image changes.
  • Keyboard stays on the guest: pressing a frame button (Home, Power, volume) no longer takes the Mac keyboard away from the Linux desktop.
  • No more black screen after a VM restart: the window reconnects to the display by itself.
  • ORCHARD_SIMULATOR_BACKGROUND=1 opens the window without bringing it to the front.

Tested by using the simulator all day for the launcher and lock-screen work in OrchardLinux/omarchy-a#80: both devices, all four orientations, and VM restarts.

- Device menu: iPad 6 or iPhone 7, each with its own realistic frame and
  panel size (`simulator/vm device`); the VM keeps the choice.
- Rotate Left/Right (Ctrl+Cmd+Left/Right) turns the whole device frame.
  A VM-only IIO accelerometer (orchard-vm-accel) reports the gravity the
  turned device would feel, so iio-sensor-proxy and the desktop's own
  rotation path do the rest, as on a tablet.
- The frame's buttons send their key without taking the Mac keyboard away
  from the guest.
- The display reconnects after the VM restarts instead of staying black.
- ORCHARD_SIMULATOR_BACKGROUND=1 opens the window without activating it.

Assisted-by: LLM
…evice only after a clean stop

simulator/setup rebuilt the VM modules only when the backlight module
was missing, so an existing disk never got orchard-vm-accel.ko and
install-linux.sh then refused to run. simulator/vm device wrote the new
device before stopping, so a stop that timed out still switched the
panel on the next start.
…vice switch

- The display bridge tells a guest that stops showing a surface (D-Bus
  Disable, connection open) apart from a closed connection: only the
  latter reconnects, so a Disable no longer starts a second connection.
  A closed connection's loop ends and frees what it held, so a VM
  restart leaves no thread behind.
- When the guest's screen appears again, the window reads the VM's
  device file: a `simulator/vm device iphone7` from a terminal brings
  the iPhone's frame (and the Device menu's tick) with it.

Assisted-by: LLM
@henrikklee
henrikklee merged commit 68dad1d into main Nov 19, 2026
11 checks passed
@henrikklee
henrikklee deleted the simulator-rotation-and-phone branch November 19, 2026 16:09
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