Skip to content

Commit

Permalink
windows: bump windows-sys to 0.52
Browse files Browse the repository at this point in the history
  • Loading branch information
kchibisov authored Apr 22, 2024
1 parent babbb71 commit 2491f2b
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ features = [
unicode-segmentation = "1.7.1"

[target.'cfg(target_os = "windows")'.dependencies.windows-sys]
version = "0.48"
version = "0.52.0"
features = [
"Win32_Devices_HumanInterfaceDevice",
"Win32_Foundation",
Expand Down
2 changes: 1 addition & 1 deletion src/platform_impl/windows/dpi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ pub unsafe fn hwnd_dpi(hwnd: HWND) -> u32 {
if unsafe { IsProcessDPIAware() } != false.into() {
// If the process is DPI aware, then scaling must be handled by the application using
// this DPI value.
unsafe { GetDeviceCaps(hdc, LOGPIXELSX) as u32 }
unsafe { GetDeviceCaps(hdc, LOGPIXELSX as i32) as u32 }
} else {
// If the process is DPI unaware, then scaling is performed by the OS; we thus return
// 96 (scale factor 1.0) to prevent the window from being re-scaled by both the
Expand Down
2 changes: 1 addition & 1 deletion src/platform_impl/windows/drop_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ impl FileDropHandler {
let get_data_fn = unsafe { (*(*data_obj).cast::<IDataObjectVtbl>()).GetData };
let get_data_result = unsafe { get_data_fn(data_obj as *mut _, &drop_format, &mut medium) };
if get_data_result >= 0 {
let hdrop = unsafe { medium.Anonymous.hGlobal };
let hdrop = unsafe { medium.u.hGlobal as HDROP };

// The second parameter (0xFFFFFFFF) instructs the function to return the item count
let item_count = unsafe { DragQueryFileW(hdrop, 0xFFFFFFFF, ptr::null_mut(), 0) };
Expand Down
2 changes: 1 addition & 1 deletion src/platform_impl/windows/icon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ impl RgbaIcon {
let pixels =
unsafe { std::slice::from_raw_parts_mut(rgba.as_ptr() as *mut Pixel, pixel_count) };
for pixel in pixels {
and_mask.push(pixel.a.wrapping_sub(std::u8::MAX)); // invert alpha channel
and_mask.push(pixel.a.wrapping_sub(u8::MAX)); // invert alpha channel
pixel.convert_to_bgra();
}
assert_eq!(and_mask.len(), pixel_count);
Expand Down
2 changes: 1 addition & 1 deletion src/platform_impl/windows/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ pub fn is_maximized(window: HWND) -> bool {
let mut placement: WINDOWPLACEMENT = mem::zeroed();
placement.length = mem::size_of::<WINDOWPLACEMENT>() as u32;
GetWindowPlacement(window, &mut placement);
placement.showCmd == SW_MAXIMIZE
placement.showCmd == SW_MAXIMIZE as u32
}
}

Expand Down
12 changes: 6 additions & 6 deletions src/platform_impl/windows/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1030,7 +1030,7 @@ impl Window {
unsafe {
DwmSetWindowAttribute(
self.hwnd(),
DWMWA_SYSTEMBACKDROP_TYPE,
DWMWA_SYSTEMBACKDROP_TYPE as u32,
&(backdrop_type as i32) as *const _ as _,
mem::size_of::<DWM_SYSTEMBACKDROP_TYPE>() as _,
);
Expand Down Expand Up @@ -1089,7 +1089,7 @@ impl Window {
unsafe {
DwmSetWindowAttribute(
self.hwnd(),
DWMWA_BORDER_COLOR,
DWMWA_BORDER_COLOR as u32,
&color as *const _ as _,
mem::size_of::<Color>() as _,
);
Expand All @@ -1101,7 +1101,7 @@ impl Window {
unsafe {
DwmSetWindowAttribute(
self.hwnd(),
DWMWA_CAPTION_COLOR,
DWMWA_CAPTION_COLOR as u32,
&color as *const _ as _,
mem::size_of::<Color>() as _,
);
Expand All @@ -1113,7 +1113,7 @@ impl Window {
unsafe {
DwmSetWindowAttribute(
self.hwnd(),
DWMWA_TEXT_COLOR,
DWMWA_TEXT_COLOR as u32,
&color as *const _ as _,
mem::size_of::<Color>() as _,
);
Expand All @@ -1125,7 +1125,7 @@ impl Window {
unsafe {
DwmSetWindowAttribute(
self.hwnd(),
DWMWA_WINDOW_CORNER_PREFERENCE,
DWMWA_WINDOW_CORNER_PREFERENCE as u32,
&(preference as DWM_WINDOW_CORNER_PREFERENCE) as *const _ as _,
mem::size_of::<DWM_WINDOW_CORNER_PREFERENCE>() as _,
);
Expand Down Expand Up @@ -1494,7 +1494,7 @@ impl Drop for ComInitialized {
thread_local! {
static COM_INITIALIZED: ComInitialized = {
unsafe {
CoInitializeEx(ptr::null(), COINIT_APARTMENTTHREADED);
CoInitializeEx(ptr::null(), COINIT_APARTMENTTHREADED as u32);
ComInitialized(ptr::null_mut())
}
};
Expand Down

0 comments on commit 2491f2b

Please sign in to comment.