Skip to content

[Breaking change]: Fix top-level window size for non-linear dimensions based on AutoScaleMode in PermonitorV2 DPI mode #33696

Closed

Description

@dreddy-work

Description

In PermonV2 mode applications, we have been using linear sizes (also known as DPI-scaled sizes) provided by Windows for top-level windows, regardless of the AutoScaleMode. This has been problematic when using the AutoScaleMode.Font, as Form scaling should be non-linear in this case, as the child controls are scaled non-linearly and depend on the Font that was assigned to the Form or child controls.

We are enabling WM.GETDPISCALEDSIZE message handling for top -level Form and utilize GetDpiScaledSize to let Windows know that Form may need non-linear sizes depending on AutoScaleMode.

Version

.NET 8 Preview 1

Previous behavior

In PermonV2 mode applications, top-level windows (Forms in this case) always scaled by Windows and is ignoring the AutoScaleMode. This resulted in inconsistant scaling between Form and its child controls.

New behavior

In PermonV2 mode applications, top-level windows (such as Forms) will now be scaled according to the AutoScaleMode, ensuring consistency with the scaling of their child controls.

Type of breaking change

  • Binary incompatible: Existing binaries may encounter a breaking change in behavior, such as failure to load or execute, and if so, require recompilation.
  • Source incompatible: When recompiled using the new SDK or component or to target the new runtime, existing source code may require source changes to compile successfully.
  • Behavioral change: Existing binaries may behave differently at run time.

Reason for change

Improving the High DPI experience in PermonitorV2 mode WinForms applications.

Recommended action

NA

Feature area

Windows Forms

Affected APIs

NA


Associated WorkItem - 62397

Activity

  1. added
    breaking-change
    on Jan 24, 2023
  2. added
    🏁 Release: .NET 8
    and removed
    ⌚ Not Triaged
    on Jan 24, 2023
  3. ghost added
    in-pr
    on Feb 1, 2023
  4. moved this from 🔖 Ready to 🏗 In progress in dotnet/docs February 2023 sprinton Feb 1, 2023
  5. added
    🗺️ reQUEST
    on Feb 3, 2023
  6. added
    📌 seQUESTered
    and removed
    🗺️ reQUEST
    on Feb 3, 2023
  7. moved this from 🏗 In progress to ✅ Done in dotnet/docs February 2023 sprinton Feb 14, 2023
  8. ghost removed
    in-pr
    on Feb 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

🏁 Release: .NET 8📌 seQUESTeredbreaking-change

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions