-
Notifications
You must be signed in to change notification settings - Fork 6
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
windows-only function for setting DPI #1
base: master
Are you sure you want to change the base?
Conversation
Thank you for the contribution, let me check it on my windows machine in my free time :) |
|
||
[dependencies] | ||
winapi = "0.3.9" |
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.
winapi should not be a global dependency because it is target specific
[dependencies] | ||
winapi = "0.3.9" | ||
winit = "0.27.5" |
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.
There should be a way to extract the data you need without using winit, check the winit source, you might find something there. I say this because the mouse_position
library is a read library without dependencies to rendering libraries like winit and this can be a problem in certain use cases
use winit::event_loop::EventLoop; | ||
|
||
// forgive me | ||
let mut monitors = (*EventLoop::new()).available_monitors(); |
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.
This part you can do it with the simple winapi, you don't need to use winit (although I understand how simple it can be), anyway I previously recommended to look at the implementation of winit, here is the way they do it
https://github.com/rust-windowing/winit/blob/master/src/platform_impl/windows/monitor.rs#L108-L119
for use with higher-res monitors - adds winit as a dependency for getting DPI
(first pr, apologies if this isn't the right way)