Skip to content

Run a virtual iPhone on an Apple Silicon Mac.

Swift

Duo: aim the wallpaper with the device-side orientation code

Jacky808002320b93
diff --git a/Research/Guest/iphone_duo_bringup.md b/Research/Guest/iphone_duo_bringup.md
index fbbf96bc..66b47701 100644
--- a/Research/Guest/iphone_duo_bringup.md
+++ b/Research/Guest/iphone_duo_bringup.md
@@ -3943,3 +3943,16 @@ rotation or posture paths; the native wallpaper rotation owns the
follow. Verified: boot-rest-90 wallpaper present and upright, rotations
0/90/270/90 all correct, cover lock wallpaper intact, close→open cycle
upright landscape. The dylib handler remains registered but idle.
+
+Follow-up (wallpaper direction, corrected): the wallpaper controller takes
+the device-side orientation code, whose landscape names mirror the UI ones
+(UI landscape-left 4 presents upright as 3; portrait stays 1) — passing the
+raw interface code quarter-turned the image on every landscape. The pulse
+posts removed earlier are restored and the pulse maps its target through
+that mirror before re-aiming the controller and sizing the views. Verified
+by brightest-pole measurements of the wallpaper across boot-rest 90,
+portrait, 90, and close→open cycles (pole at the top in each). Known
+remaining edge: an explicit 270 rotation leaves the wallpaper view
+portrait-sized at the landscape interface (content upright-ish but
+letterboxed) — the 270-side native layout races the pulse's frame pass;
+chase separately if 270 matters on the hardware.
diff --git a/VPhoneDaemon/Daemon/GuestAPI+Device.swift b/VPhoneDaemon/Daemon/GuestAPI+Device.swift
index e32b0a1e..45e6f145 100644
--- a/VPhoneDaemon/Daemon/GuestAPI+Device.swift
+++ b/VPhoneDaemon/Daemon/GuestAPI+Device.swift
@@ -132,6 +132,7 @@ extension GuestAPI {
_ = try? postDarwinNotification("com.vphone.display.orientation.inputs.refresh", state: nil)
_ = try? postDarwinNotification("com.vphone.display.orientation.arbitration.refresh", state: nil)
_ = try? postDarwinNotification("com.vphone.display.orientation.actuation.refresh", state: nil)
+ _ = try? postDarwinNotification("com.vphone.display.presentation.wallpaper.pulse", state: nil)
_ = try? postDarwinNotification("com.vphone.display.presentation.clock.refresh", state: nil)
}
var result: [String: Any]
@@ -509,6 +510,7 @@ extension GuestAPI {
_ = try? postDarwinNotification("com.vphone.display.orientation.pose.refresh", state: nil)
_ = try? postDarwinNotification("com.vphone.display.orientation.arbitration.refresh", state: nil)
_ = try? postDarwinNotification("com.vphone.display.orientation.actuation.refresh", state: nil)
+ _ = try? postDarwinNotification("com.vphone.display.presentation.wallpaper.pulse", state: nil)
_ = try? postDarwinNotification("com.vphone.display.presentation.clock.refresh", state: nil)
if !settled {
// Reuse the same public rotation path once the new panel
diff --git a/VPhoneGuestComponents/FoldDisplay/libvphonefolddisplay.m b/VPhoneGuestComponents/FoldDisplay/libvphonefolddisplay.m
index cac1a5b9..c39655d6 100644
--- a/VPhoneGuestComponents/FoldDisplay/libvphonefolddisplay.m
+++ b/VPhoneGuestComponents/FoldDisplay/libvphonefolddisplay.m
@@ -1708,6 +1708,13 @@ static void vpPulseNativeWallpaperOrientation(void) {
!bm || strcmp(method_getTypeEncoding(bm), "v24@0:8q16") != 0) return;
NSInteger original = ((NSInteger (*)(id, SEL))objc_msgSend)(wallpaper, getter);
NSInteger target = [[vpReadObject(scene, "traitsPipelineManager") valueForKey:@"systemArbitratedInterfaceOrientation"] integerValue];
+ // The wallpaper controller takes the device-side orientation, whose
+ // landscape names mirror the UI ones (UI landscape-left 4 is device
+ // landscape-right 3); passing the raw interface code lands the image
+ // a quarter turn off on every landscape. Measured on iPhone19,4:
+ // portrait stays 1, interface 4 renders upright as 3.
+ if (target == 3) target = 4;
+ else if (target == 4) target = 3;
if (original < 1 || original > 4 || target < 1 || target > 4) return;
vpWallpaperOrientationLeaseActive = YES;
@try {