Skip to content

Commit

Permalink
feat(core): add app-region: drag to data-tauri-drag-region (#9789)
Browse files Browse the repository at this point in the history
  • Loading branch information
Legend-Master authored May 22, 2024
1 parent 0b690f2 commit ae6b13d
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changes/app-region-drag.md
Original file line number Diff line number Diff line change
@@ -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 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion core/tauri-runtime-wry/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
5 changes: 5 additions & 0 deletions core/tauri/src/window/scripts/drag.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]
}
})()
4 changes: 2 additions & 2 deletions examples/api/src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ae6b13d

Please sign in to comment.