-
Notifications
You must be signed in to change notification settings - Fork 24
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
Dpi awareness support #5
Conversation
- All values returns in wpf units - Project update for StyleCop rules - Bugfix for SystemInformation.VirtualScreen returning only primary screen
…hould set WindowStyle="None" ResizeMode="NoResize" properties for window or you will get position problem. See dotnet/wpf#4127)
WindowHelper added; Some fixes for SystemInformation;
Did you checked if the framework as the dpi awareness in the new sources? From winforms or wpf new sources? Because last time I did this library if I remember well I simply took the sources from winforms source code that were release publicly, now that is also open sourced and they did new netcore version maybe they did something about that we can copy as well? |
Can't say about winforms but in WPF dpi awareness is working from NET Framework 4.6.0. I suppose winforms works too. |
@FoxPride what about create the DpiTest as net5 app? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@FoxPride what about create the DpiTest as net5 app?
I'm doing it apart, moving under test
folder with a name like WpfScreenHelper.DpiTestWpfApp
.NET 5 should work too. I can bump version and rename project if you want to. |
I'm doing a cleanup and will push it |
I'm making some test and I can't reproduce the problem. first of all why you have to set this in the manifest:
when the default manifest template for a net5 wpf app says this:
BTW I run your sample app and when I move the window to a scaled monitor, it doesn't move correctly. I have 3 monitor, on one I've set a 150% scale, I'm doing it right? It seems to work only when I align to top-right, right and bottom-right, if you have the window on unscaled monitor and you click to center on the scaled monitor, it will end up in the middle of the two monitors. If I drag the window on the scaled monitor I saw that it changes the size when half the window is on the scaled window, then the buttons you add works as expected. If I add the actual published v1.0.0 package in fact is getting worst, because when the window is dragged on the scaled monitor, the buttons works badly, so the changes are of course doing something good 😉 But it works fine with v1.0.0 if I leave the manifest unchanged as dpi-aware should be already in every WPF app, and it works better (also works the center, left-right and right button from another monitor to a scaled one), why? I'm for sure ignorant on this topic, so I'm trying to understand 😄 |
Looks like they changed smth for dpi scale in .NET 5 🤔. So it's better to stick to new manifest then.
I have the same configuration (150% and 100% monitors), works with 4.7.1 version. I'll test it for 5.0.0.
Oh I see. Looks like size of window ends up being bigger for second monitor and on first move can't detect dpi changed event. That's why it moves window to the center of two monitors.
May be in .NET 5.0.0 we finally have right coordinates with scale calculation? If so that's a great news for future development (unfortunately not for older .NET Framework). I'll check it out! |
in the meanwhile I did some code review and pushed on your branch, take a look at it |
@FoxPride should we bump the version to a non-breaking change or to a breaking change one? 1.1.0 or 2.0.0? |
🤔I designed changes to be compatible with previous version. So it can be just 1.1.0 update as for me. |
Thank you! I will have a look. |
@micdenny Finally tested .NET 5.0 project on several setups and it works just fine! Small note: on windows 10 commenting manifest section about dpi awareness changes nothing so it can be used for windows 7\8 setup. |
published on nuget https://www.nuget.org/packages/WpfScreenHelper/1.1.0 |
No description provided.