diff --git a/Cargo.lock b/Cargo.lock index 495a17a9c1fc..2c6b45cbe720 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1199,7 +1199,7 @@ dependencies = [ "web-sys", "web-time", "wgpu", - "windows-sys 0.59.0", + "windows-sys 0.52.0", "winit", ] @@ -4678,15 +4678,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets 0.52.6", -] - [[package]] name = "windows-targets" version = "0.42.2" diff --git a/crates/eframe/Cargo.toml b/crates/eframe/Cargo.toml index bf5442e7adae..3343a153bf3f 100644 --- a/crates/eframe/Cargo.toml +++ b/crates/eframe/Cargo.toml @@ -183,7 +183,7 @@ objc2-app-kit = { version = "0.2.0", features = [ # windows: [target.'cfg(any(target_os = "windows"))'.dependencies] -windows-sys = { version = "0.59", features = [ +windows-sys = { version = "0.52", features = [ "Win32_UI_WindowsAndMessaging", "Win32_UI_Input_KeyboardAndMouse", ] } diff --git a/crates/eframe/src/native/app_icon.rs b/crates/eframe/src/native/app_icon.rs index b751e66cba19..6d3cb2ff1ca1 100644 --- a/crates/eframe/src/native/app_icon.rs +++ b/crates/eframe/src/native/app_icon.rs @@ -94,7 +94,7 @@ fn set_app_icon_windows(icon_data: &IconData) -> AppIconStatus { // SAFETY: Windows API function without side-effects. let window_handle = unsafe { KeyboardAndMouse::GetActiveWindow() }; - if window_handle.is_null() { + if window_handle == 0 { // The Window isn't available yet. Try again later! return AppIconStatus::NotSetTryAgain; } @@ -123,7 +123,7 @@ fn set_app_icon_windows(icon_data: &IconData) -> AppIconStatus { ) .is_err() { - return std::ptr::null_mut(); + return 0; } // SAFETY: Creating an HICON which should be readonly on our data. @@ -159,7 +159,7 @@ fn set_app_icon_windows(icon_data: &IconData) -> AppIconStatus { let icon_size_big = unsafe { WindowsAndMessaging::GetSystemMetrics(WindowsAndMessaging::SM_CXICON) }; let icon_big = create_hicon_with_scale(&unscaled_image, icon_size_big); - if icon_big.is_null() { + if icon_big == 0 { log::warn!("Failed to create HICON (for big icon) from embedded png data."); return AppIconStatus::NotSetIgnored; // We could try independently with the small icon but what's the point, it would look bad! } else { @@ -169,7 +169,7 @@ fn set_app_icon_windows(icon_data: &IconData) -> AppIconStatus { window_handle, WindowsAndMessaging::WM_SETICON, WindowsAndMessaging::ICON_BIG as usize, - icon_big as isize, + icon_big, ); } } @@ -179,7 +179,7 @@ fn set_app_icon_windows(icon_data: &IconData) -> AppIconStatus { let icon_size_small = unsafe { WindowsAndMessaging::GetSystemMetrics(WindowsAndMessaging::SM_CXSMICON) }; let icon_small = create_hicon_with_scale(&unscaled_image, icon_size_small); - if icon_small.is_null() { + if icon_small == 0 { log::warn!("Failed to create HICON (for small icon) from embedded png data."); return AppIconStatus::NotSetIgnored; } else { @@ -189,7 +189,7 @@ fn set_app_icon_windows(icon_data: &IconData) -> AppIconStatus { window_handle, WindowsAndMessaging::WM_SETICON, WindowsAndMessaging::ICON_SMALL as usize, - icon_small as isize, + icon_small, ); } }