Skip to content

Commit

Permalink
chore(deps): update to windows-rs 0.56 and other deps (#1224)
Browse files Browse the repository at this point in the history
* chore(deps): update to windows-rs 0.56 and other deps

* Update windows-rs-0-56.md
  • Loading branch information
amrbashir authored Apr 18, 2024
1 parent 3e3d59c commit ca6b5fb
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 18 deletions.
5 changes: 5 additions & 0 deletions .changes/windows-rs-0-56.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"wry": "patch"
---

Update `windows` crate to `0.56`
15 changes: 8 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,22 +55,23 @@ raw-window-handle = { version = "0.6", features = [ "std" ] }
dpi = "0.1"

[target."cfg(any(target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies]
javascriptcore-rs = { version = "=1.1", features = [ "v2_28" ], optional = true }
webkit2gtk = { version = "=2.0", features = [ "v2_38" ], optional = true }
webkit2gtk-sys = { version = "=2.0", optional = true }
javascriptcore-rs = { version = "=1.1.2", features = [ "v2_28" ], optional = true }
webkit2gtk = { version = "=2.0.1", features = [ "v2_38" ], optional = true }
webkit2gtk-sys = { version = "=2.0.1", optional = true }
gtk = { version = "0.18", optional = true }
soup3 = { version = "0.5", optional = true }
x11-dl = { version = "2.9", optional = true }
x11-dl = { version = "2.21", optional = true }
gdkx11 = { version = "0.18", optional = true }
percent-encoding = "2.1"

[target."cfg(target_os = \"windows\")".dependencies]
webview2-com = "0.29"
webview2-com = "0.30"
windows-version = "0.1"
windows-core = "0.56"
dunce = "1"

[target."cfg(target_os = \"windows\")".dependencies.windows]
version = "0.54"
version = "0.56"
features = [
"implement",
"Win32_Foundation",
Expand Down Expand Up @@ -101,7 +102,7 @@ crossbeam-channel = "0.5"
html5ever = "0.26"
kuchiki = { package = "kuchikiki", version = "0.8" }
sha2 = "0.10"
base64 = "0.21"
base64 = "0.22"
jni = "0.21"
ndk = "0.7"
ndk-sys = "0.4"
Expand Down
2 changes: 1 addition & 1 deletion bench/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ repository = "https://github.com/tauri-apps/wry"
[dependencies]
anyhow = "1.0"
time = { version = "0.3", features = ["formatting"] }
tempfile = "3.8.0"
tempfile = "3.10"
serde_json = "1.0"
serde = { version = "1.0", features = [ "derive" ] }

Expand Down
8 changes: 4 additions & 4 deletions src/webview2/drag_drop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ impl DragDropController {
let closure = &mut *(lparam.0 as *mut c_void as *mut &mut dyn FnMut(HWND) -> bool);
closure(hwnd).into()
}
unsafe { EnumChildWindows(hwnd, Some(enumerate_callback), lparam) };
let _ = unsafe { EnumChildWindows(hwnd, Some(enumerate_callback), lparam) };
}

controller
Expand Down Expand Up @@ -163,7 +163,7 @@ impl IDropTarget_Impl for DragDropTarget {
pdwEffect: *mut DROPEFFECT,
) -> windows::core::Result<()> {
let mut pt = POINT { x: pt.x, y: pt.y };
unsafe { ScreenToClient(self.hwnd, &mut pt) };
let _ = unsafe { ScreenToClient(self.hwnd, &mut pt) };

let mut paths = Vec::new();
let hdrop = unsafe { Self::iterate_filenames(pDataObj, |path| paths.push(path)) };
Expand Down Expand Up @@ -196,7 +196,7 @@ impl IDropTarget_Impl for DragDropTarget {
) -> windows::core::Result<()> {
if unsafe { *self.enter_is_valid.get() } {
let mut pt = POINT { x: pt.x, y: pt.y };
unsafe { ScreenToClient(self.hwnd, &mut pt) };
let _ = unsafe { ScreenToClient(self.hwnd, &mut pt) };
(self.listener)(DragDropEvent::Over {
position: (pt.x as _, pt.y as _),
});
Expand All @@ -222,7 +222,7 @@ impl IDropTarget_Impl for DragDropTarget {
) -> windows::core::Result<()> {
if unsafe { *self.enter_is_valid.get() } {
let mut pt = POINT { x: pt.x, y: pt.y };
unsafe { ScreenToClient(self.hwnd, &mut pt) };
let _ = unsafe { ScreenToClient(self.hwnd, &mut pt) };

let mut paths = Vec::new();
let hdrop = unsafe { Self::iterate_filenames(pDataObj, |path| paths.push(path)) };
Expand Down
12 changes: 6 additions & 6 deletions src/webview2/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1007,15 +1007,15 @@ impl InnerWebView {
if msg == *EXEC_MSG_ID {
let mut function: Box<Box<dyn FnMut()>> = Box::from_raw(wparam.0 as *mut _);
function();
RedrawWindow(hwnd, None, HRGN::default(), RDW_INTERNALPAINT);
let _ = RedrawWindow(hwnd, None, HRGN::default(), RDW_INTERNALPAINT);
return LRESULT(0);
}

DefSubclassProc(hwnd, msg, wparam, lparam)
}

unsafe fn attach_main_thread_dispatcher(hwnd: HWND) {
SetWindowSubclass(
let _ = SetWindowSubclass(
hwnd,
Some(Self::main_thread_dispatcher_proc),
MAIN_THREAD_DISPATCHER_SUBCLASS_ID as _,
Expand Down Expand Up @@ -1078,7 +1078,7 @@ impl InnerWebView {
drop(Box::from_raw(dwrefdata as *mut ICoreWebView2Controller));

// update `dwrefdata` to null to avoid double-freeing the controller
SetWindowSubclass(
let _ = SetWindowSubclass(
hwnd,
Some(Self::parent_subclass_proc),
PARENT_SUBCLASS_ID as _,
Expand All @@ -1095,7 +1095,7 @@ impl InnerWebView {

#[inline]
unsafe fn attach_parent_subclass(parent: HWND, controller: &ICoreWebView2Controller) {
SetWindowSubclass(
let _ = SetWindowSubclass(
parent,
Some(Self::parent_subclass_proc),
PARENT_SUBCLASS_ID as _,
Expand All @@ -1111,7 +1111,7 @@ impl InnerWebView {
WPARAM::default(),
LPARAM::default(),
);
RemoveWindowSubclass(
let _ = RemoveWindowSubclass(
parent,
Some(Self::parent_subclass_proc),
PARENT_SUBCLASS_ID as _,
Expand Down Expand Up @@ -1266,7 +1266,7 @@ impl InnerWebView {

pub fn set_visible(&self, visible: bool) -> Result<()> {
unsafe {
ShowWindow(
let _ = ShowWindow(
self.hwnd,
match visible {
true => SW_SHOW,
Expand Down

0 comments on commit ca6b5fb

Please sign in to comment.