Update to windows-sys 0.59 (#4098)

This commit is contained in:
valadaptive 2025-02-23 22:40:11 -05:00 committed by GitHub
parent 3a39a6ddb0
commit 23011c6b0a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 166 additions and 137 deletions

View file

@ -73,7 +73,7 @@ pub fn dpi_to_scale_factor(dpi: u32) -> f64 {
pub unsafe fn hwnd_dpi(hwnd: HWND) -> u32 {
let hdc = unsafe { GetDC(hwnd) };
if hdc == 0 {
if hdc.is_null() {
panic!("[winit] `GetDC` returned null!");
}
if let Some(GetDpiForWindow) = *GET_DPI_FOR_WINDOW {
@ -85,7 +85,7 @@ pub unsafe fn hwnd_dpi(hwnd: HWND) -> u32 {
} else if let Some(GetDpiForMonitor) = *GET_DPI_FOR_MONITOR {
// We are on Windows 8.1 or later.
let monitor = unsafe { MonitorFromWindow(hwnd, MONITOR_DEFAULTTONEAREST) };
if monitor == 0 {
if monitor.is_null() {
return BASE_DPI;
}