Skip to content

Commit 385a41d

Browse files
authored
enhance(windows): disable our in-client resizing for undecorated window with shadows (#12817)
* enhance(windows): disable our in-client resizing for undecorated window with shadows ref: tauri-apps/tao#1052 * skip hittesting for undeceorated windows
1 parent 955832e commit 385a41d

File tree

5 files changed

+199
-61
lines changed

5 files changed

+199
-61
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"tauri": "patch:enhance"
3+
---
4+
5+
On Windows, undecorated window with shadows, now have native resize handles outside of the window client area.

Cargo.lock

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/tauri-runtime-wry/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ wry = { version = "0.50.0", default-features = false, features = [
2323
"os-webview",
2424
"linux-body",
2525
] }
26-
tao = { version = "0.32.1", default-features = false, features = ["rwh_06"] }
26+
tao = { version = "0.32.2", default-features = false, features = ["rwh_06"] }
2727
tauri-runtime = { version = "2.3.0", path = "../tauri-runtime" }
2828
tauri-utils = { version = "2.1.1", path = "../tauri-utils" }
2929
raw-window-handle = "0.6"

crates/tauri-runtime-wry/src/lib.rs

+13-4
Original file line numberDiff line numberDiff line change
@@ -3013,7 +3013,10 @@ fn handle_user_message<T: UserEvent>(
30133013
if !resizable {
30143014
undecorated_resizing::detach_resize_handler(window.hwnd());
30153015
} else if !window.is_decorated() {
3016-
undecorated_resizing::attach_resize_handler(window.hwnd());
3016+
undecorated_resizing::attach_resize_handler(
3017+
window.hwnd(),
3018+
window.has_undecorated_shadow(),
3019+
);
30173020
}
30183021
}
30193022
WindowMessage::SetMaximizable(maximizable) => window.set_maximizable(maximizable),
@@ -3039,12 +3042,18 @@ fn handle_user_message<T: UserEvent>(
30393042
if decorations {
30403043
undecorated_resizing::detach_resize_handler(window.hwnd());
30413044
} else if window.is_resizable() {
3042-
undecorated_resizing::attach_resize_handler(window.hwnd());
3045+
undecorated_resizing::attach_resize_handler(
3046+
window.hwnd(),
3047+
window.has_undecorated_shadow(),
3048+
);
30433049
}
30443050
}
30453051
WindowMessage::SetShadow(_enable) => {
30463052
#[cfg(windows)]
3047-
window.set_undecorated_shadow(_enable);
3053+
{
3054+
window.set_undecorated_shadow(_enable);
3055+
undecorated_resizing::update_drag_hwnd_rgn_for_undecorated(window.hwnd(), _enable);
3056+
}
30483057
#[cfg(target_os = "macos")]
30493058
window.set_has_shadow(_enable);
30503059
}
@@ -4490,7 +4499,7 @@ fn create_webview<T: UserEvent>(
44904499
undecorated_resizing::attach_resize_handler(&webview);
44914500
#[cfg(windows)]
44924501
if window.is_resizable() && !window.is_decorated() {
4493-
undecorated_resizing::attach_resize_handler(window.hwnd());
4502+
undecorated_resizing::attach_resize_handler(window.hwnd(), window.has_undecorated_shadow());
44944503
}
44954504
}
44964505

0 commit comments

Comments
 (0)