Skip to content

Commit ae6b13d

Browse files
feat(core): add app-region: drag to data-tauri-drag-region (#9789)
1 parent 0b690f2 commit ae6b13d

File tree

5 files changed

+15
-5
lines changed

5 files changed

+15
-5
lines changed

.changes/app-region-drag.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"tauri": patch:feat
3+
---
4+
5+
Add `app-region: drag` to HTML elements with `data-tauri-drag-region` on Windows, only WebView2 123+, which should fix dragging using touch.

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/tauri-runtime-wry/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ edition = { workspace = true }
1313
rust-version = { workspace = true }
1414

1515
[dependencies]
16-
wry = { version = "0.39.3", default-features = false, features = [ "drag-drop", "protocol", "os-webview" ] }
16+
wry = { version = "0.40", default-features = false, features = [ "drag-drop", "protocol", "os-webview" ] }
1717
tao = { version = "0.28", default-features = false, features = [ "rwh_06" ] }
1818
tauri-runtime = { version = "2.0.0-beta.16", path = "../tauri-runtime" }
1919
tauri-utils = { version = "2.0.0-beta.15", path = "../tauri-utils" }

core/tauri/src/window/scripts/drag.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,9 @@
6363
}
6464
})
6565
}
66+
if (osName === 'windows' && 'adoptedStyleSheets' in document) {
67+
const sheet = new CSSStyleSheet()
68+
sheet.replaceSync('*[data-tauri-drag-region] { app-region: drag; }')
69+
document.adoptedStyleSheets = [...document.adoptedStyleSheets, sheet]
70+
}
6671
})()

examples/api/src-tauri/Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)