Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update anchors with Windows suggested rectangle in case of top-level window #9214

Closed
wants to merge 4 commits into from

Conversation

dreddy-work
Copy link
Member

@dreddy-work dreddy-work commented Jun 1, 2023

Fixes #9200.

Microsoft Reviewers: Open in CodeFlow

@ghost ghost assigned dreddy-work Jun 1, 2023
@@ -1453,8 +1453,25 @@ internal void ScaleContainerForDpi(int deviceDpiNew, int deviceDpiOld, Rectangle
// events on the control.

// Bounds are being scaled for the top-level window via SuggestedRectangle. We would need to skip scaling of
Copy link
Member

Choose a reason for hiding this comment

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

You still reference SuggestedRectangle in this comment

(WINDOW_EX_STYLE)cp.ExStyle,
(uint)deviceDpiNew);
#pragma warning restore CA1416 // Validate platform compatibility
WindowsSuggestedClientRectangle = new Rectangle(
Copy link
Member

Choose a reason for hiding this comment

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

// this control further by the 'OnFontChanged' event.
_isScaledByDpiChangedEvent = true;
// this control further by the 'OnFontChanged' event. WindowsSuggestedClientRectangle property will help in that.
WindowsSuggestedClientRectangle = suggestedRectangle;
Copy link
Member

Choose a reason for hiding this comment

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

There is a chance that this rectangle would not be used, i.e. there are no children to anchor. So calculation of the client rect could be delayed until needed.

@dreddy-work dreddy-work closed this Oct 3, 2023
@dreddy-work dreddy-work deleted the dev/dreddy/fix9200_1 branch October 3, 2023 19:47
@ghost ghost locked as resolved and limited conversation to collaborators Nov 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
draft draft PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RadioButton and CheckBox are not scaled well on the secondary monitor when application is in PerMonitorV2 mode
2 participants