diff --git a/.changes/windows-0.58.md b/.changes/windows-0.58.md new file mode 100644 index 000000000..6ec8e8d83 --- /dev/null +++ b/.changes/windows-0.58.md @@ -0,0 +1,5 @@ +--- +"wry": minor +--- + +Updated `windows` to 0.58. diff --git a/Cargo.toml b/Cargo.toml index 1a74c1ce5..ab3514b2b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -65,14 +65,14 @@ gdkx11 = { version = "0.18", optional = true } percent-encoding = "2.3" [target."cfg(target_os = \"windows\")".dependencies] -webview2-com = "0.31" +webview2-com = "0.33" windows-version = "0.1" -windows-core = "0.57" +windows-core = "0.58" dunce = "1" - [target."cfg(target_os = \"windows\")".dependencies.windows] - version = "0.57" - features = [ +[target."cfg(target_os = \"windows\")".dependencies.windows] +version = "0.58" +features = [ "implement", "Win32_Foundation", "Win32_Graphics_Gdi", @@ -92,8 +92,8 @@ dunce = "1" [target."cfg(any(target_os = \"ios\", target_os = \"macos\"))".dependencies] block = "0.1" -cocoa = "0.25" -core-graphics = "0.23" +cocoa = "0.26" +core-graphics = "0.24" objc = "0.2" objc_id = "0.1" diff --git a/src/webview2/drag_drop.rs b/src/webview2/drag_drop.rs index 7ccc5489d..0bdc3f59d 100644 --- a/src/webview2/drag_drop.rs +++ b/src/webview2/drag_drop.rs @@ -154,7 +154,7 @@ impl DragDropTarget { } #[allow(non_snake_case)] -impl IDropTarget_Impl for DragDropTarget { +impl IDropTarget_Impl for DragDropTarget_Impl { fn DragEnter( &self, pDataObj: Option<&IDataObject>, @@ -166,7 +166,7 @@ impl IDropTarget_Impl for DragDropTarget { let _ = unsafe { ScreenToClient(self.hwnd, &mut pt) }; let mut paths = Vec::new(); - let hdrop = unsafe { Self::iterate_filenames(pDataObj, |path| paths.push(path)) }; + let hdrop = unsafe { DragDropTarget::iterate_filenames(pDataObj, |path| paths.push(path)) }; (self.listener)(DragDropEvent::Enter { paths, position: (pt.x as _, pt.y as _), @@ -225,7 +225,7 @@ impl IDropTarget_Impl for DragDropTarget { let _ = unsafe { ScreenToClient(self.hwnd, &mut pt) }; let mut paths = Vec::new(); - let hdrop = unsafe { Self::iterate_filenames(pDataObj, |path| paths.push(path)) }; + let hdrop = unsafe { DragDropTarget::iterate_filenames(pDataObj, |path| paths.push(path)) }; (self.listener)(DragDropEvent::Drop { paths, position: (pt.x as _, pt.y as _), diff --git a/src/webview2/mod.rs b/src/webview2/mod.rs index 3f44f00e9..23bc14fea 100644 --- a/src/webview2/mod.rs +++ b/src/webview2/mod.rs @@ -227,7 +227,7 @@ impl InnerWebView { HMENU::default(), GetModuleHandleW(PCWSTR::null()).unwrap_or_default(), None, - ) + )? }; unsafe { @@ -1293,10 +1293,10 @@ impl InnerWebView { } pub fn reparent(&self, parent: isize) -> Result<()> { - let parent = HWND(parent); + let parent = HWND(parent as _); unsafe { - SetParent(self.hwnd, parent); + SetParent(self.hwnd, parent)?; if !self.is_child { Self::dettach_parent_subclass(*self.parent.borrow()); diff --git a/src/webview2/util.rs b/src/webview2/util.rs index e11429b97..8f822e42c 100644 --- a/src/webview2/util.rs +++ b/src/webview2/util.rs @@ -68,7 +68,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 = MonitorFromWindow(hwnd, MONITOR_DEFAULTTONEAREST); - if monitor.0 == 0 { + if monitor.is_invalid() { return BASE_DPI; }