windows: bump windows-sys to 0.52
This commit is contained in:
parent
babbb715c5
commit
2491f2bbd6
6 changed files with 11 additions and 11 deletions
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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) };
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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 _,
|
||||
);
|
||||
|
|
@ -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 _,
|
||||
);
|
||||
|
|
@ -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 _,
|
||||
);
|
||||
|
|
@ -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 _,
|
||||
);
|
||||
|
|
@ -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 _,
|
||||
);
|
||||
|
|
@ -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())
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue