feat(core): add app-region: drag to data-tauri-drag-region (#9789)

This commit is contained in:
Tony 2024-05-23 00:45:39 +08:00 committed by GitHub
parent 0b690f242f
commit ae6b13dfc0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 15 additions and 5 deletions

View File

@ -0,0 +1,5 @@
---
"tauri": patch:feat
---
Add `app-region: drag` to HTML elements with `data-tauri-drag-region` on Windows, only WebView2 123+, which should fix dragging using touch.

4
Cargo.lock generated
View File

@ -4885,9 +4885,9 @@ dependencies = [
[[package]]
name = "wry"
version = "0.39.3"
version = "0.40.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6e180ac2740d6cb4d5cec0abf63eacbea90f1b7e5e3803043b13c1c84c4b7884"
checksum = "7cd42682bad8d1efd0e0d0593770c602c13b8922bb1ca705cb845967de81bbc4"
dependencies = [
"base64 0.22.0",
"block",

View File

@ -13,7 +13,7 @@ edition = { workspace = true }
rust-version = { workspace = true }
[dependencies]
wry = { version = "0.39.3", default-features = false, features = [ "drag-drop", "protocol", "os-webview" ] }
wry = { version = "0.40", default-features = false, features = [ "drag-drop", "protocol", "os-webview" ] }
tao = { version = "0.28", default-features = false, features = [ "rwh_06" ] }
tauri-runtime = { version = "2.0.0-beta.16", path = "../tauri-runtime" }
tauri-utils = { version = "2.0.0-beta.15", path = "../tauri-utils" }

View File

@ -63,4 +63,9 @@
}
})
}
if (osName === 'windows' && 'adoptedStyleSheets' in document) {
const sheet = new CSSStyleSheet()
sheet.replaceSync('*[data-tauri-drag-region] { app-region: drag; }')
document.adoptedStyleSheets = [...document.adoptedStyleSheets, sheet]
}
})()

View File

@ -4257,9 +4257,9 @@ dependencies = [
[[package]]
name = "wry"
version = "0.39.5"
version = "0.40.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c7172fc76376d55d089c627a31a5b604b4ac372793fb5378d1c7ddf008703008"
checksum = "7cd42682bad8d1efd0e0d0593770c602c13b8922bb1ca705cb845967de81bbc4"
dependencies = [
"base64 0.22.1",
"block",