Repository: tauri-apps/wry (language: rust)

Issue:
fix(deps): update rust crate webview2-com to 0.35
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [webview2-com](https://redirect.github.com/wravery/webview2-rs) | dependencies | minor | `0.34` -> `0.35` |

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/tauri-apps/wry).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS45Mi4wIiwidXBkYXRlZEluVmVyIjoiMzkuOTIuMCIsInRhcmdldEJyYW5jaCI6ImRldiIsImxhYmVscyI6W119-->



Discussion / hints:
<!-- Covector Action -->
### Package Changes Through 7e32cc5b7800e3687c8fee3cc0e20deacf1ff61a
No changes.

[Add a change file through the GitHub UI by following this link.](https://github.com/tauri-apps/wry/new/renovate/webview2-com-0.x?filename=.changes/change-pr-1453.md&value=---%0A%22wry%22:%20patch%0A---%0A%0Afix(deps):%20update%20rust%20crate%20webview2-com%20to%200.35%0A)


---
<p align='right'><em>Read about <a href='../tree/HEAD/.changes'>change files</a><em> or the docs at <a href='https://github.com/jbolda/covector/tree/main/packages/covector'>github.com/jbolda/covector</a><em></p>

Fix patch:
diff --git a/.changes/webview2-0.35-windows-0.59.md b/.changes/webview2-0.35-windows-0.59.md
new file mode 100644
index 000000000..8fb5f76db
--- /dev/null
+++ b/.changes/webview2-0.35-windows-0.59.md
@@ -0,0 +1,5 @@
+---
+wry: minor
+---
+
+Updated `webview2-com` to `0.35`, `windows` to `0.59`.
diff --git a/Cargo.toml b/Cargo.toml
index eff01b361..1d545df7c 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -68,15 +68,14 @@ gdkx11 = { version = "0.18", optional = true }
 percent-encoding = "2.3"
 
 [target."cfg(target_os = \"windows\")".dependencies]
-webview2-com = "0.34"
+webview2-com = "0.35"
 windows-version = "0.1"
-windows-core = "0.58"
+windows-core = "0.59"
 dunce = "1"
 
 [target."cfg(target_os = \"windows\")".dependencies.windows]
-version = "0.58"
+version = "0.59"
 features = [
-  "implement",
   "Win32_Foundation",
   "Win32_Graphics_Gdi",
   "Win32_System_Com",
diff --git a/src/lib.rs b/src/lib.rs
index ca9f436af..037f4a6db 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -591,7 +591,7 @@ pub struct WebViewAttributes<'a> {
   pub background_throttling: Option<BackgroundThrottlingPolicy>,
 }
 
-impl<'a> Default for WebViewAttributes<'a> {
+impl Default for WebViewAttributes<'_> {
   fn default() -> Self {
     Self {
       id: Default::default(),
diff --git a/src/webview2/drag_drop.rs b/src/webview2/drag_drop.rs
index cf3efe8c0..67111c985 100644
--- a/src/webview2/drag_drop.rs
+++ b/src/webview2/drag_drop.rs
@@ -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()
       }
-      let _ = unsafe { EnumChildWindows(hwnd, Some(enumerate_callback), lparam) };
+      let _ = unsafe { EnumChildWindows(Some(hwnd), Some(enumerate_callback), lparam) };
     }
 
     controller
@@ -94,7 +94,10 @@ impl DragDropTarget {
     }
   }
 
-  unsafe fn iterate_filenames<F>(data_obj: Option<&IDataObject>, mut callback: F) -> Option<HDROP>
+  unsafe fn iterate_filenames<F>(
+    data_obj: windows_core::Ref<'_, IDataObject>,
+    mut callback: F,
+  ) -> Option<HDROP>
   where
     F: FnMut(PathBuf),
   {
@@ -157,7 +160,7 @@ impl DragDropTarget {
 impl IDropTarget_Impl for DragDropTarget_Impl {
   fn DragEnter(
     &self,
-    pDataObj: Option<&IDataObject>,
+    pDataObj: windows_core::Ref<'_, IDataObject>,
     _grfKeyState: MODIFIERKEYS_FLAGS,
     pt: &POINTL,
     pdwEffect: *mut DROPEFFECT,
@@ -224,7 +227,7 @@ impl IDropTarget_Impl for DragDropTarget_Impl {
 
   fn Drop(
     &self,
-    pDataObj: Option<&IDataObject>,
+    pDataObj: windows_core::Ref<'_, IDataObject>,
     _grfKeyState: MODIFIERKEYS_FLAGS,
     pt: &POINTL,
     _pdwEffect: *mut DROPEFFECT,
diff --git a/src/webview2/mod.rs b/src/webview2/mod.rs
index ca4bb96c7..564ca2e11 100644
--- a/src/webview2/mod.rs
+++ b/src/webview2/mod.rs
@@ -237,9 +237,9 @@ impl InnerWebView {
         y,
         width,
         height,
-        parent,
-        HMENU::default(),
-        GetModuleHandleW(PCWSTR::null()).unwrap_or_default(),
+        Some(parent),
+        None,
+        GetModuleHandleW(PCWSTR::null()).map(Into::into).ok(),
         None,
       )?
     };
@@ -247,7 +247,7 @@ impl InnerWebView {
     unsafe {
       SetWindowPos(
         hwnd,
-        HWND_TOP,
+        Some(HWND_TOP),
         0,
         0,
         0,
@@ -1040,7 +1040,7 @@ impl InnerWebView {
 
     let raw = Box::into_raw(boxed2);
 
-    let _res = PostMessageW(hwnd, *EXEC_MSG_ID, WPARAM(raw as _), LPARAM(0));
+    let _res = PostMessageW(Some(hwnd), *EXEC_MSG_ID, WPARAM(raw as _), LPARAM(0));
 
     #[cfg(any(debug_assertions, feature = "tracing"))]
     if let Err(err) = _res {
@@ -1067,7 +1067,7 @@ impl InnerWebView {
     if msg == *EXEC_MSG_ID {
       let mut function: Box<Box<dyn FnMut()>> = Box::from_raw(wparam.0 as *mut _);
       function();
-      let _ = RedrawWindow(hwnd, None, HRGN::default(), RDW_INTERNALPAINT);
+      let _ = RedrawWindow(Some(hwnd), None, None, RDW_INTERNALPAINT);
       return LRESULT(0);
     }
 
@@ -1139,7 +1139,7 @@ impl InnerWebView {
           if (*controller).ParentWindow(&mut hwnd).is_ok() {
             let _ = SetWindowPos(
               hwnd,
-              HWND::default(),
+              None,
               0,
               0,
               width,
@@ -1193,12 +1193,7 @@ impl InnerWebView {
 
   #[inline]
   unsafe fn dettach_parent_subclass(parent: HWND) {
-    SendMessageW(
-      parent,
-      PARENT_DESTROY_MESSAGE,
-      WPARAM::default(),
-      LPARAM::default(),
-    );
+    SendMessageW(parent, PARENT_DESTROY_MESSAGE, None, None);
     let _ = RemoveWindowSubclass(
       parent,
       Some(Self::parent_subclass_proc),
@@ -1321,7 +1316,7 @@ impl InnerWebView {
         x: rect.left,
         y: rect.top,
       }];
-      unsafe { MapWindowPoints(self.hwnd, *self.parent.borrow(), position_point) };
+      unsafe { MapWindowPoints(Some(self.hwnd), Some(*self.parent.borrow()), position_point) };
 
       bounds.position = PhysicalPosition::new(position_point[0].x, position_point[0].y).into();
     } else {
@@ -1348,7 +1343,7 @@ impl InnerWebView {
 
       SetWindowPos(
         self.hwnd,
-        HWND::default(),
+        None,
         position.x,
         position.y,
         size.width,
@@ -1436,7 +1431,7 @@ impl InnerWebView {
     unsafe {
       let parent = *self.parent.borrow();
       if parent != HWND::default() {
-        SetFocus(parent)?;
+        SetFocus(Some(parent))?;
       }
     }
 
@@ -1553,7 +1548,7 @@ impl InnerWebView {
     let parent = HWND(parent as _);
 
     unsafe {
-      SetParent(self.hwnd, parent)?;
+      SetParent(self.hwnd, Some(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 8f822e42c..f227e15dc 100644
--- a/src/webview2/util.rs
+++ b/src/webview2/util.rs
@@ -81,7 +81,7 @@ pub unsafe fn hwnd_dpi(hwnd: HWND) -> u32 {
       BASE_DPI
     }
   } else {
-    let hdc = GetDC(hwnd);
+    let hdc = GetDC(Some(hwnd));
     if hdc.is_invalid() {
       return BASE_DPI;
     }
@@ -90,7 +90,7 @@ pub unsafe fn hwnd_dpi(hwnd: HWND) -> u32 {
     if IsProcessDPIAware().as_bool() {
       // If the process is DPI aware, then scaling must be handled by the application using
       // this DPI value.
-      GetDeviceCaps(hdc, LOGPIXELSX) as u32
+      GetDeviceCaps(Some(hdc), LOGPIXELSX) 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


Test patch: