Skip to content

WI01087563 Fix high DPI anchor layout regression#26

Open
FahmiFuzi wants to merge 1 commit into
masterfrom
FFZ/WI01087563/G9-WinForms-AnchorCompat
Open

WI01087563 Fix high DPI anchor layout regression#26
FahmiFuzi wants to merge 1 commit into
masterfrom
FFZ/WI01087563/G9-WinForms-AnchorCompat

Conversation

@FahmiFuzi

Copy link
Copy Markdown

Fixes WI01087563

Proposed changes

  • Restore cached anchor bounds for high-DPI stretch refresh cases where the proposed bounds are wider/taller than the display area.
  • Add regression coverage for nested anchored controls at high DPI.
  • Keep the fix scoped to anchor layout compatibility behavior.

Customer Impact

  • Reduces .NET 10 WinForms layout regressions where anchored child controls are resized outside their parent by DPI/runtime rounding.
  • Avoids requiring downstream products to patch individual forms and controls for framework-level anchor behavior.

Regression?

  • Yes. .NET 10 behavior diverged from the previous .NET 8 / .NET Framework layout behavior under high DPI anchoring.

Risk

  • Moderate: layout code is shared, but the change is guarded by cached bounds and display-area checks so it only applies when the current stretch refresh would produce bounds beyond the available display area while the cached bounds still fit.

Screenshots

N/A - layout regression is covered by automated bounds assertions.

Test methodology

  • ./eng/common/dotnet.cmd test src/System.Windows.Forms.Legacy/System.Windows.Forms.Legacy.Tests/System.Windows.Forms.Legacy.Tests.csproj --filter "FullyQualifiedName~AnchorLayoutHighDpiRegressionTests" --logger "console%3Bverbosity=minimal"
  • Verified the same repro fails on unpatched origin/master and passes with this patch.
  • Validated downstream CargoWise Group 9 tests using this patched runtime.

Accessibility testing

N/A - no new UI or accessibility surface; this restores layout bounds behavior.

Test environment(s)

  • Windows
  • .NET 10 WinForms build/test environment
  • High-DPI regression test coverage

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