diff --git a/.github/workflows/release-app.yml b/.github/workflows/release-app.yml index d3a73d5c..c3432afb 100644 --- a/.github/workflows/release-app.yml +++ b/.github/workflows/release-app.yml @@ -13,12 +13,12 @@ jobs: fail-fast: false matrix: include: - - platform: "macos-latest" # for Arm-based Macs (M1 and above). + - platform: "macos-26" # for Arm-based Macs (M1 and above). args: "--target aarch64-apple-darwin" yaak_arch: "arm64" os: "macos" targets: "aarch64-apple-darwin" - - platform: "macos-latest" # for Intel-based Macs. + - platform: "macos-26-intel" # for Intel-based Macs. args: "--target x86_64-apple-darwin" yaak_arch: "x64" os: "macos" diff --git a/crates-tauri/yaak-mac-window/src/mac.rs b/crates-tauri/yaak-mac-window/src/mac.rs index 4be6ab43..c5b5cdba 100644 --- a/crates-tauri/yaak-mac-window/src/mac.rs +++ b/crates-tauri/yaak-mac-window/src/mac.rs @@ -12,6 +12,11 @@ unsafe impl Sync for UnsafeWindowHandle {} const WINDOW_CONTROL_PAD_X: f64 = 13.0; const WINDOW_CONTROL_PAD_Y: f64 = 18.0; +/// Extra pixels to add to the title bar height when the default title bar is +/// already as tall as button_height + PAD_Y (i.e. macOS Tahoe 26+, where the +/// default is 32px and 14 + 18 = 32). On pre-Tahoe this is unused because the +/// default title bar is shorter than button_height + PAD_Y. +const TITLEBAR_EXTRA_HEIGHT: f64 = 4.0; const MAIN_WINDOW_PREFIX: &str = "main_"; pub(crate) fn update_window_title(window: Window, title: String) { @@ -95,12 +100,29 @@ fn position_traffic_lights(ns_window_handle: UnsafeWindowHandle, x: f64, y: f64, ns_window.standardWindowButton_(NSWindowButton::NSWindowMiniaturizeButton); let zoom = ns_window.standardWindowButton_(NSWindowButton::NSWindowZoomButton); - let title_bar_container_view = close.superview().superview(); - let close_rect: NSRect = msg_send![close, frame]; let button_height = close_rect.size.height; - let title_bar_frame_height = button_height + y; + let title_bar_container_view = close.superview().superview(); + + // Capture the OS default title bar height on the first call, before + // we've modified it. This avoids the height growing on repeated calls. + use std::sync::OnceLock; + static DEFAULT_TITLEBAR_HEIGHT: OnceLock = OnceLock::new(); + let default_height = + *DEFAULT_TITLEBAR_HEIGHT.get_or_init(|| NSView::frame(title_bar_container_view).size.height); + + // On pre-Tahoe, button_height + y is larger than the default title bar + // height, so the resize works as before. On Tahoe (26+), the default is + // already 32px and button_height + y = 32, so nothing changes. In that + // case, add TITLEBAR_EXTRA_HEIGHT extra pixels to push the buttons down. + let desired = button_height + y; + let title_bar_frame_height = if desired > default_height { + desired + } else { + default_height + TITLEBAR_EXTRA_HEIGHT + }; + let mut title_bar_rect = NSView::frame(title_bar_container_view); title_bar_rect.size.height = title_bar_frame_height; title_bar_rect.origin.y = NSView::frame(ns_window).size.height - title_bar_frame_height; diff --git a/src-web/components/HeaderSize.tsx b/src-web/components/HeaderSize.tsx index 03a951ab..5944e011 100644 --- a/src-web/components/HeaderSize.tsx +++ b/src-web/components/HeaderSize.tsx @@ -40,7 +40,7 @@ export function HeaderSize({ } else if (type() === 'macos') { if (!isFullscreen) { // Add large padding for window controls - s.paddingLeft = 72 / settings.interfaceScale; + s.paddingLeft = 76 / settings.interfaceScale; } } else if (!ignoreControlsSpacing && !settings.hideWindowControls) { s.paddingRight = WINDOW_CONTROLS_WIDTH; diff --git a/src-web/lib/constants.ts b/src-web/lib/constants.ts index 14eab995..67dbaf8c 100644 --- a/src-web/lib/constants.ts +++ b/src-web/lib/constants.ts @@ -1,4 +1,4 @@ -export const HEADER_SIZE_MD = '27px'; +export const HEADER_SIZE_MD = '30px'; export const HEADER_SIZE_LG = '40px'; export const WINDOW_CONTROLS_WIDTH = '10.5rem';