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

WPF Popup - Change to absolute positioning #916

Merged
merged 3 commits into from
Apr 10, 2015
Merged

WPF Popup - Change to absolute positioning #916

merged 3 commits into from
Apr 10, 2015

Conversation

svantreeck
Copy link
Contributor

This avoids win 8/8.1 menu alignment settings where they can cause devices to not show relative positioned popups where expected.

This fixes issue #906

This avoids win 8/8.1 menu alignment settings
popup.HorizontalOffset = popupOffset.X / matrix.M11;
popup.VerticalOffset = popupOffset.Y / matrix.M22;
var locationFromScreen = this.PointToScreen(popupOffset);
var targetPoint =
Copy link
Member

Choose a reason for hiding this comment

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

Use matrix to perform the transform.

@amaitland
Copy link
Member

@svantreeck Couple of minor changes, apart from that looks solid 👍 Thanks for the contribution!

@svantreeck
Copy link
Contributor Author

I updated the code...tested and working on windows 10. I'll check it out on a few other boxes (8.1 and 7) tomorrow morning to double check things look ok there because things didn't look correct with DPI scaling when I first turned it tried the code in Win10, so now that its right there, I very possibly messed up on 7/8/8.1

@amaitland
Copy link
Member

I very possibly messed up on 7/8/8.1

No problem, DPI scaling can be fiddly to get working in all scenarios. Let us know how you go 👍

@amaitland amaitland added this to the 39.0.0 milestone Mar 30, 2015
@amaitland amaitland changed the title Updated the Popup settings WPF Popup - Change to absolute positioning Mar 31, 2015
@svantreeck
Copy link
Contributor Author

It looks fine to me on win 8.1, I think its good to go unless you can see any issues with it.

@amaitland
Copy link
Member

It will need testing using a range of scenarios. Does it work under win 7?

@amaitland
Copy link
Member

Looks like the width/height also needs to be scaled.

@@ -1067,9 +1067,10 @@ private void SetPopupSizeAndPositionImpl(int width, int height, int x, int y)
popup.Width = width;
Copy link
Member

Choose a reason for hiding this comment

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

I think we need to scale the width and height from the results I'm seeing on Win7 at 1.25

@svantreeck
Copy link
Contributor Author

I would second that...I have a screen with 150% scaling and was getting an ugly black background around the edges. Commited an update to scale the width and height by the matrix.

@amaitland
Copy link
Member

Commited an update to scale the width and height by the matrix.

Great 👍

Can you give a quick summary of all the combinations you've tested with so far? Basically looks like it's working now, just need to make sure we haven't missed anything before committing.

@svantreeck
Copy link
Contributor Author

I've tested on:
Windows 8.1 with 100% DPI scaling
Windows 10 with 100% and 150% DPI scaling
Windows Server 2008 R2 with 100% DPI scaling

@amaitland amaitland modified the milestones: 39.0.1, 39.0.0 Apr 7, 2015
amaitland added a commit that referenced this pull request Apr 10, 2015
WPF Popup - Change to absolute positioning
@amaitland amaitland merged commit 4f38686 into cefsharp:master Apr 10, 2015
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.

2 participants