Skip to content

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

@dreddy-work

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

Metadata

Metadata

Assignees

Labels

🏁 Release: .NET 8Work items for the .NET 8 release📌 seQUESTeredIdentifies that an issue has been imported into Quest.breaking-changeIndicates a .NET Core breaking change

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions