Skip to content

Commit

Permalink
feat(webview2): enable non-client region support (#1262)
Browse files Browse the repository at this point in the history
closes #1245
  • Loading branch information
amrbashir committed May 14, 2024
1 parent 0f3c886 commit f516122
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changes/webview-drag-client-region.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"wry": "patch"
---

On Windows, enable webview2 [non client region support](https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2settings9?view=webview2-1.0.2478.35#get_isnonclientregionsupportenabled) which allows using `app-region` CSS style.
4 changes: 4 additions & 0 deletions src/webview2/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,10 @@ impl InnerWebView {
let settings6 = settings.cast::<ICoreWebView2Settings6>()?;
settings6.SetIsSwipeNavigationEnabled(attributes.back_forward_navigation_gestures)?;

if let Ok(settings9) = settings.cast::<ICoreWebView2Settings9>() {
settings9.SetIsNonClientRegionSupportEnabled(true)?;
}

Ok(())
}

Expand Down

0 comments on commit f516122

Please sign in to comment.