Skip to content

Commit 9546548

Browse files
authored
fix(macos): set default title-bar style to Visible, close #10225 (#10297)
* fix(macos): set default title-bar style to `Visible` * chore: add TODO
1 parent 7acac58 commit 9546548

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"tauri": "patch:bug"
3+
"tauri-runtime-wry": "patch"
4+
---
5+
6+
On macOS, set default titlebar style to `Visible` to prevent webview move out of the view.

core/tauri-runtime-wry/src/lib.rs

+14-1
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,20 @@ unsafe impl Send for WindowBuilderWrapper {}
715715
impl WindowBuilderBase for WindowBuilderWrapper {}
716716
impl WindowBuilder for WindowBuilderWrapper {
717717
fn new() -> Self {
718-
Self::default().focused(true)
718+
#[allow(unused_mut)]
719+
let mut builder = Self::default().focused(true);
720+
721+
#[cfg(target_os = "macos")]
722+
{
723+
// TODO: find a proper way to prevent webview being pushed out of the window.
724+
// Workround for issue: https://github.com/tauri-apps/tauri/issues/10225
725+
// The window requies `NSFullSizeContentViewWindowMask` flag to prevent devtools
726+
// pushing the content view out of the window.
727+
// By setting the default style to `TitleBarStyle::Visible` should fix the issue for most of the users.
728+
builder = builder.title_bar_style(TitleBarStyle::Visible);
729+
}
730+
731+
builder
719732
}
720733

721734
fn with_config(config: &WindowConfig) -> Self {

0 commit comments

Comments
 (0)