-
-
Notifications
You must be signed in to change notification settings - Fork 70
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
Incorrect scale_factor on Windows #176
Comments
#177 let dpi_type = {
cfg_if! {
if #[cfg(feature = "windows_hi_dpi_effective")] {
use windows::Win32::UI::HiDpi::MDT_EFFECTIVE_DPI;
MDT_EFFECTIVE_DPI
} else if #[cfg(feature = "windows_hi_dpi_angular")] {
use windows::Win32::UI::HiDpi::MDT_ANGULAR_DPI;
MDT_ANGULAR_DPI
} else {
use windows::Win32::UI::HiDpi::MDT_RAW_DPI;
MDT_RAW_DPI
}
}
}; |
@caesay Does this align with your expectations? |
Hi, thanks for looking at this, and I think the changes you made will work fine for me, but the only valid flag for determining screen DPI is MDT_EFFECTIVE_DPI, so I'm not sure the cargo features are needed to gate this. If I could provide a suggestion, ideally the implementation should just use The current implementation in #177 means that I have to choose whether I target windows 7/8 or 8.1+ at compile time, since without the feature it will not work on 8.1+ and with the feature it will not work on 7. |
The cargo features have been removed and replaced with dynamic linking. Additionally, it now detects whether the current process has DPI awareness enabled, and automatically switches the method for obtaining DPI accordingly.
|
This issue is now closed. If it is not resolved, please reopen it. |
If dpiAware is set in application manifest eg.
Then xcap will return
scale_factor = 1.0
always, which is incorrect. The GetDpiForMonitor function should be used to determine the monitor scale.The text was updated successfully, but these errors were encountered: