Skip to content

Commit

Permalink
feat: webview2 composition support
Browse files Browse the repository at this point in the history
  • Loading branch information
yydcnjjw authored and jiangjw committed Feb 19, 2024
1 parent 8c86fba commit 17ec729
Show file tree
Hide file tree
Showing 3 changed files with 1,150 additions and 15 deletions.
9 changes: 9 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1032,6 +1032,7 @@ pub(crate) struct PlatformSpecificWebViewAttributes {
browser_accelerator_keys: bool,
theme: Option<Theme>,
https_scheme: bool,
composition: bool,
}

#[cfg(windows)]
Expand All @@ -1042,6 +1043,7 @@ impl Default for PlatformSpecificWebViewAttributes {
browser_accelerator_keys: true, // This is WebView2's default behavior
theme: None,
https_scheme: false, // To match macOS & Linux behavior in the context of mixed content.
composition: false,
}
}
}
Expand Down Expand Up @@ -1078,6 +1080,8 @@ pub trait WebViewBuilderExtWindows {
///
/// The default value is `false`.
fn with_https_scheme(self, enabled: bool) -> Self;

fn with_composition(self, enabled: bool) -> Self;
}

#[cfg(windows)]
Expand All @@ -1101,6 +1105,11 @@ impl WebViewBuilderExtWindows for WebViewBuilder<'_> {
self.platform_specific.https_scheme = enabled;
self
}

fn with_composition(mut self, enabled: bool) -> Self {
self.platform_specific.composition = enabled;
self
}
}

#[cfg(target_os = "android")]
Expand Down
Loading

0 comments on commit 17ec729

Please sign in to comment.