Skip to content

Commit

Permalink
chore(deps): update windows crate to 0.58 (#1341)
Browse files Browse the repository at this point in the history
* chore(deps): update windows crate to 0.58

* core-graphics

* add change file

---------

Co-authored-by: Lucas Nogueira <[email protected]>
  • Loading branch information
amrbashir and lucasfernog authored Aug 16, 2024
1 parent 0218ace commit a23a28d
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 14 deletions.
5 changes: 5 additions & 0 deletions .changes/windows-0.58.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"wry": minor
---

Updated `windows` to 0.58.
14 changes: 7 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"

Expand Down
6 changes: 3 additions & 3 deletions src/webview2/drag_drop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>,
Expand All @@ -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 _),
Expand Down Expand Up @@ -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 _),
Expand Down
6 changes: 3 additions & 3 deletions src/webview2/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ impl InnerWebView {
HMENU::default(),
GetModuleHandleW(PCWSTR::null()).unwrap_or_default(),
None,
)
)?
};

unsafe {
Expand Down Expand Up @@ -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());
Expand Down
2 changes: 1 addition & 1 deletion src/webview2/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit a23a28d

Please sign in to comment.