Skip to content

Commit

Permalink
Merge branch 'tauri-apps:dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
mzdk100 authored Jan 14, 2025
2 parents f46ef07 + 95a9319 commit a95b2d3
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 39 deletions.
5 changes: 0 additions & 5 deletions .changes/disable-background-throttling.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changes/traffic-light-inset.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changes/webview2-0.35-windows-0.59.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
wry: minor
---

Updated `webview2-com` to `0.35`, `windows` to `0.59`.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## \[0.48.1]

- [`cbbcccc`](https://github.com/tauri-apps/wry/commit/cbbcccc38af7d900a0f8f7fa5ea5e6667765ed81) ([#1446](https://github.com/tauri-apps/wry/pull/1446) by [@FabianLars](https://github.com/tauri-apps/wry/../../FabianLars)) Add functionality to set the traffic light inset on macOS. This is required to prevent flickers if the WebView is injected via `build()` instead of `build_as_child()`.

### enhance

- [`26abf63`](https://github.com/tauri-apps/wry/commit/26abf63d79c4a0fcff8ea39d0ff677686f5b546c) ([#1445](https://github.com/tauri-apps/wry/pull/1445) by [@bastiankistner](https://github.com/tauri-apps/wry/../../bastiankistner)) Add an option to change the default background throttling policy (currently for WebKit only).

## \[0.48.0]

- [`eb0c816`](https://github.com/tauri-apps/wry/commit/eb0c8163f1e2a11115ef1928b5e4bf0a8f083f3b) ([#1423](https://github.com/tauri-apps/wry/pull/1423) by [@SpikeHD](https://github.com/tauri-apps/wry/../../SpikeHD)) Rename `{WebViewBuilderExtWindows, WebViewBuilderExtUnix}::with_extension_path` to `with_extensions_path`.
Expand Down
9 changes: 4 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ workspace = {}

[package]
name = "wry"
version = "0.48.0"
version = "0.48.1"
authors = ["Tauri Programme within The Commons Conservancy"]
edition = "2021"
license = "Apache-2.0 OR MIT"
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
11 changes: 7 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()
}
let _ = unsafe { EnumChildWindows(hwnd, Some(enumerate_callback), lparam) };
let _ = unsafe { EnumChildWindows(Some(hwnd), Some(enumerate_callback), lparam) };
}

controller
Expand Down Expand Up @@ -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),
{
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
29 changes: 12 additions & 17 deletions src/webview2/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,17 +247,17 @@ 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,
)?
};

unsafe {
SetWindowPos(
hwnd,
HWND_TOP,
Some(HWND_TOP),
0,
0,
0,
Expand Down Expand Up @@ -1050,7 +1050,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 {
Expand All @@ -1077,7 +1077,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);
}

Expand Down Expand Up @@ -1149,7 +1149,7 @@ impl InnerWebView {
if (*controller).ParentWindow(&mut hwnd).is_ok() {
let _ = SetWindowPos(
hwnd,
HWND::default(),
None,
0,
0,
width,
Expand Down Expand Up @@ -1203,12 +1203,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),
Expand Down Expand Up @@ -1331,7 +1326,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 {
Expand All @@ -1358,7 +1353,7 @@ impl InnerWebView {

SetWindowPos(
self.hwnd,
HWND::default(),
None,
position.x,
position.y,
size.width,
Expand Down Expand Up @@ -1446,7 +1441,7 @@ impl InnerWebView {
unsafe {
let parent = *self.parent.borrow();
if parent != HWND::default() {
SetFocus(parent)?;
SetFocus(Some(parent))?;
}
}

Expand Down Expand Up @@ -1563,7 +1558,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());
Expand Down
4 changes: 2 additions & 2 deletions src/webview2/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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
Expand Down

0 comments on commit a95b2d3

Please sign in to comment.