Skip to content

[iOS] DeviceDisplay: Track scene geometry and display handoffs (.NET 10) - #39879

Merged
kubaflo merged 1 commit into
release/10.0.1xx-sr13from
jfversluis-devicedisplay-net-10-pr
Nov 4, 2026
Merged

kubaflo merged 1 commit into
release/10.0.1xx-sr13from
jfversluis-devicedisplay-net-10-pr

Conversation

@jfversluis

@jfversluis jfversluis commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

Description of Change

.NET 10 servicing port targeting release/10.0.1xx-sr13, following up on #39398 and replacing #39870. Related alternative: #39403.

Observe the selected window scene's effective geometry and reselect it as windows and scene lifecycle state change. Read metrics from that scene's screen so display dimensions, density and refresh rate follow Duo display handoffs, including geometry changes without physical device rotation. Orient dimensions using the scene's interface orientation when screen bounds lag during a handoff.

On iOS 27+, detect scene-backed versus legacy operation at runtime, retaining orientation notifications when no usable scene is available. Preserve the older-iOS notification fallback and account for interface-oriented screen bounds. Mac Catalyst behavior is unchanged. No public API is added.

Validation

The commands below used the installed .NET 11 RC SDK against the .NET 10 targets, with REPO_ROOT set to the absolute path of the .NET 10 checkout:

  • Passed: 20 focused unit tests:
    cd /tmp && dotnet test "$REPO_ROOT/src/Essentials/test/UnitTests/Essentials.UnitTests.csproj" -c Debug -f net10.0 -p:_MauiDotNetTfm=net10.0 --no-restore --filter 'FullyQualifiedName~Tests.DeviceDisplay_Tests' --verbosity quiet
  • Passed: production Essentials iOS build with 0 warnings and 0 errors:
    dotnet build "$REPO_ROOT/src/Essentials/src/Essentials.csproj" -c Debug -f net10.0-ios26.0 -p:_MauiDotNetTfm=net10.0 --no-restore --verbosity quiet
  • Simulator runtime, .NET 10 port: a session-only MAUI app linked to the exact port-built Essentials assembly. The same scene geometry request changed the display from 1398 × 2034 portrait to 2034 × 1398 landscape without an additional physical-orientation notification. With the parent commit's DeviceDisplay sources there was no MainDisplayInfoChanged event; with this fix there was one event with the correct dimensions and rotation.
  • Duo handoffs, .NET 10 port: with the scene held in the same landscape orientation, opening the simulated Duo left the parent-commit app reporting the cover-screen 2034 × 1398 dimensions and no event. The fixed app emitted a new event reporting the inner-screen 2853 × 2007 dimensions, then another event returning to 2034 × 1398 on refolding; no additional physical-orientation notification occurred. Closed, open and partially open poses were exercised.
  • No-manifest app: the fixed assembly raised a correctly oriented event on both a current-runtime compatibility scene and an older iOS simulator. Opening and refolding the current-runtime compatibility app left its letterboxed virtual display unchanged, so no additional display event was expected or observed.
  • Runtime caveat: the .NET 10 probe used ValidateXcodeVersion=false with the installed Xcode 27 and .NET 10 iOS SDK, an unsupported toolchain combination. Its no-manifest variant also used a simulator-only iOS 26.5 linker SDK setting. Nine warnings came from the probe's diagnostic instrumentation, not the production Essentials build.
  • Coverage limits: physical hardware was not tested, and the committed device tests do not automate a real cross-screen handoff.
  • Not validated locally: device-test host compilation requires repository build tasks. Building Microsoft.Maui.BuildTasks.slnf failed while archiving MauiPlatformInterop under the installed Xcode (xcodebuild exit code 65); device tests were not run locally on this branch. The device-test CI pipeline has been requested.

Issues Fixed

Fixes #39182

Observe selected-scene geometry and screen metrics on iOS 27+, with lifecycle rebinding and legacy fallback. Cover display handoffs, listener cleanup, scene selection, and stale first-event bounds with regressions.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@azure-pipelines

This comment has been minimized.

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 39879

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 39879"

@jfversluis

This comment has been minimized.

@azure-pipelines

This comment has been minimized.

@kubaflo

This comment has been minimized.

@github-actions github-actions Bot added the s/agent-review-in-progress AI review is currently running for this PR label Nov 4, 2026
@kubaflo

This comment has been minimized.

@azure-pipelines

This comment has been minimized.

@MauiBot

MauiBot commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

PR Test Gate

@jfversluis — existing-test verification; Setup did not capture a tested commit.

Result INCONCLUSIVE Platform iOS


🧪 Gate analysis — click to expand

⚠ Inconclusive. Setup, build, or execution did not produce a conclusive result. This does not prove the fix is incorrect.

No interpretable test-group summary was produced. No additional test execution is inferred.

Setup did not capture a verified PR head; no commit is claimed as tested.

No immutable without-fix baseline was prepared.

@MauiBot MauiBot removed the s/agent-review-in-progress AI review is currently running for this PR label Nov 4, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expert Review — 1 finding

Reviewed commit db1e290.

See inline comments for details.

@kubaflo

This comment has been minimized.

@github-actions github-actions Bot added the s/agent-review-in-progress AI review is currently running for this PR label Nov 4, 2026
@MauiBot

MauiBot commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

PR Test Gate

@jfversluis — existing-test verification; Setup did not capture a tested commit.

Result INCONCLUSIVE Platform iOS


🧪 Gate analysis — click to expand

⚠ Inconclusive. Setup, build, or execution did not produce a conclusive result. This does not prove the fix is incorrect.

No interpretable test-group summary was produced. No additional test execution is inferred.

Setup did not capture a verified PR head; no commit is claimed as tested.

No immutable without-fix baseline was prepared.

@MauiBot MauiBot removed the s/agent-review-in-progress AI review is currently running for this PR label Nov 4, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expert Review — 1 finding

Reviewed commit db1e290.

See inline comments for details.

@kubaflo
kubaflo marked this pull request as ready for review November 4, 2026 13:27
Copilot AI balanced review requested due to automatic review settings November 4, 2026 13:27
@kubaflo
kubaflo merged commit 4d148fd into release/10.0.1xx-sr13 Nov 4, 2026
58 of 91 checks passed
@kubaflo
kubaflo deleted the jfversluis-devicedisplay-net-10-pr branch November 4, 2026 13:29
@KlaasTroost

Copy link
Copy Markdown

I have installed this PR build and the issue is solved, thanks.

@github-actions github-actions Bot added this to the .NET 10 SR13 milestone Nov 4, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Scene/KVO lifecycle, display handoffs, and headless startup still need supported-toolchain runtime and device-test validation, as simulator runs used an unsupported SDK/Xcode pairing and the device-test host was not compiled or run locally.

No open issues 🎉

What changed in this PR

This .NET 10 servicing port updates Essentials’ iOS DeviceDisplay handling for #39182, following up on #39398. It tracks scene geometry and display handoffs that occur without physical rotation, while preserving legacy fallbacks and Mac Catalyst behavior. No public API is added.

Changes:

  • Observe the selected scene’s geometry and lifecycle, using its screen metrics and interface orientation.
  • Preserve fallback orientation notifications and prevent null event subscriptions from starting listeners.
  • Add regression coverage and enable scene-based startup in the iOS Essentials device-test host.
File Description
src/​TestUtils/​src/​DeviceTests.Runners/​HeadlessRunner/​iOS/​MauiTestSceneDelegate.cs Generalizes the XML comment to cover both UIKit targets.
src/​TestUtils/​src/​DeviceTests.Runners/​HeadlessRunner/​iOS/​MauiTestApplicationDelegate.cs Extends scene-aware headless startup to iOS.
src/​Essentials/​test/​UnitTests/​DeviceDisplay_Tests.cs Tests listener lifecycle with null subscriptions.
src/​Essentials/​test/​DeviceTests/​Tests/​iOS/​DeviceDisplay_Tests.cs Adds geometry, scene-selection, lifecycle, and fallback tests.
src/​Essentials/​test/​DeviceTests/​Platforms/​iOS/​SceneDelegate.cs Adds the iOS test host’s scene delegate.
src/​Essentials/​test/​DeviceTests/​Platforms/​iOS/​Info.plist Enables scenes for the iOS test host.
src/​Essentials/​src/​DeviceDisplay/​DeviceDisplay.shared.cs Ignores null event subscriptions.
src/​Essentials/​src/​DeviceDisplay/​DeviceDisplay.ios.cs Implements scene-based metrics, observer lifecycle management, and legacy fallbacks.

Review effort: Balanced

kubaflo added a commit that referenced this pull request Nov 13, 2026
…on backports (#40217)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->

### Description of Change

**Explicit release-target exception:** this PR intentionally targets the
new `release/10.0.1xx-sr14` branch. `main`, `net11` and the inflight
lanes are now .NET 11, so .NET 10 SR14 is cut from the SR13 release head
(`release/10.0.1xx-sr14` was created at `54d76458e0`, the tip of
`release/10.0.1xx-sr13`, which already includes all post-cut SR13 fixes
#39830, #39855, #39879, #39891 and the servicing/stable configuration
from #39774).

This PR brings the .NET 10 changes needed since SR13:

1. **Backport #39887** – `[Windows] Prevent duplicate Shell startup
navigation from stale tab selection events`. Fixes #39859 (regressed in
10.0.120); it was merged only to `main`. Clean `cherry-pick -x`.
2. **Backport #40132** – `Fix custom Shape.PathForBounds dispatch
regression`. Fixes #40129 (regressed in 10.0.130); it was merged only to
`candidate/11.0.1xx-sr2`. The unrelated .NET 11
`eng/release-rollover.json` change from that commit is excluded (file
does not exist on the .NET 10 line).
3. **Version bump** – `PatchVersion` 130 → 140 in `eng/Versions.props`.
Servicing label and `StabilizePackageVersion=true` are inherited from
SR13.

Reviewed and intentionally **not** included:

- #40136 (`net10.0` Publish-Build-Assets cleanup): SR13 has no
`Publish-Build-Assets` references, so nothing to remove.
- #39882 (re-land of the CollectionView2 height fix): SR13 already
carries the revert #39855 that fixed #39847; re-landing is a
fix-forward, not a regression fix.
- #40213 (`[net10.0][XSG]` CA2252 suppression, issue #40045): still
open/unmerged; can be backported once approved.
- Other `regressed-in-10.0.1x0` issues closed since the SR13 cut
(#38622, #39557/#39681, #39722) are already fixed on SR13 or were fixed
outside MAUI.

Keep in draft pending review and CI. This PR does not tag, publish, or
authorize a release; the internal dnceng mirror of
`release/10.0.1xx-sr14` has not been created.

#### Validation

Using the pinned SDK `10.0.113` provisioned by `eng/common/dotnet.sh`:

- `dotnet msbuild eng/Versions.props
-getProperty:PatchVersion,SdkBandVersion,PreReleaseVersionLabel,StabilizePackageVersion,DotNetFinalVersionKind`
→ `140`, `10.0.100`, `servicing`, `true`, `release`. `xmllint --noout
eng/Versions.props` passed.
- `dotnet test
src/Controls/tests/Core.UnitTests/Controls.Core.UnitTests.csproj -f
net10.0 --filter FullyQualifiedName~StrokeShapeTests` (platform TFMs
disabled): **passed 59/59**. With `Shape.cs` reverted to SR13: **failed
3/59** (the new `CustomShapeReimplementingIShape*` tests); restored:
**passed 59/59**.
- #39887 is Windows-only (`ShellItemHandler.Windows.cs` + Windows device
test) and was not built locally on macOS; it relies on CI.

### Issues Fixed

Fixes #39859
Fixes #40129

<!--
Are you targeting main? All PRs should target the main branch unless
otherwise noted.
-->

---------

This branch was previously deployed

1 inactive deployment
copilot-pat-pool — db1e290b Deployed Nov 4, 2026 by jfversluis via conclusion #2681
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-essentials Essentials: Device, Display, Connectivity, Secure Storage, Sensors, App Info platform/ios platform/macos macOS / Mac Catalyst

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants