From 9776fc466b5f3a6ef47956ec5c9cdd9c5164046a Mon Sep 17 00:00:00 2001 From: Lucas Fernandes Nogueira Date: Sun, 1 May 2022 21:47:15 -0700 Subject: [PATCH] fix(macos): set titlebar style to `none` (#566) --- .changes/macos-remove-titlebar-separator.md | 5 +++++ src/webview/wkwebview/mod.rs | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 .changes/macos-remove-titlebar-separator.md diff --git a/.changes/macos-remove-titlebar-separator.md b/.changes/macos-remove-titlebar-separator.md new file mode 100644 index 000000000..bedd405aa --- /dev/null +++ b/.changes/macos-remove-titlebar-separator.md @@ -0,0 +1,5 @@ +--- +"wry": patch +--- + +Set the titlebar separator style in macOS to `none`. diff --git a/src/webview/wkwebview/mod.rs b/src/webview/wkwebview/mod.rs index ff2f3b1c3..11c49bd9d 100644 --- a/src/webview/wkwebview/mod.rs +++ b/src/webview/wkwebview/mod.rs @@ -410,7 +410,14 @@ impl InnerWebView { // ns window is required for the print operation #[cfg(target_os = "macos")] - let ns_window = window.ns_window() as id; + let ns_window = { + let ns_window = window.ns_window() as id; + + // `1` means `none`, see https://developer.apple.com/documentation/appkit/nstitlebarseparatorstyle/none + let () = msg_send![ns_window, setTitlebarSeparatorStyle: 1]; + + ns_window + }; let w = Self { webview,