fix(menubar): fall back to Thaw Bar when hiding app menus under fullscreen#741
Open
auspic7 wants to merge 1 commit into
Open
fix(menubar): fall back to Thaw Bar when hiding app menus under fullscreen#741auspic7 wants to merge 1 commit into
auspic7 wants to merge 1 commit into
Conversation
…creen Activating Thaw to hide application menus inside a fullscreen space makes macOS immediately hide the menu bar (FB13544993). The reactive sink in MenuBarManager already guards against this, but the synchronous path through MenuBarSection.show() -> presentationMode -> hideApplicationMenus() did not. Mirror the existing isFullscreen guard there: when a fullscreen space is active and the section would otherwise use inlineHidingApplicationMenus, fall back to the Thaw Bar, which is shown via orderFrontRegardless() and does not activate the app. The HideAppMenus setting is on by default, so this reproduced on fresh installs. Fixes stonerl#740.
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Adds a fullscreen guard to the synchronous "hide application menus" path in
MenuBarSection.show(), mirroring the guard already present in the reactive sink inMenuBarManager. When a fullscreen space is active and the hidden section would otherwise be presented via.inlineHidingApplicationMenus, it now falls back to.iceBar(the Thaw Bar panel) instead.PR Type
Does this PR introduce a breaking change?
Why
Activating an app inside a fullscreen space makes macOS immediately hide the menu bar — the platform behavior reported as Apple Feedback FB13544993 ("Menu bar should not hide when in fullscreen space and a LSUIElement/accessory app is activated").
Hiding application menus requires
hideApplicationMenus()→appState.activate(withPolicy: .regular)→NSApp.activate(ignoringOtherApps: true). The reactive code path already guards against running this under fullscreen:// MenuBarManager.swift guard appState.settings.advanced.hideApplicationMenus, ... !appState.activeSpace.isFullscreen, // ← guarded ...…But the synchronous path driven by a click (
ControlItem.performAction()→section.toggle()→section.show()→presentationMode(on:)→.inlineHidingApplicationMenus→hideApplicationMenus()) had no such guard, so the activation ran even under a fullscreen space and the menu bar disappeared.Since
Defaults.DefaultValue.hideApplicationMenus = true, this reproduced on a fresh install whenever a user clicked the control item while another app was fullscreen.What's new
In
MenuBarSection.show(), after computingpresentationMode(on:), if the result is.inlineHidingApplicationMenusandappState.activeSpace.isFullscreenistrue, downgrade to.iceBar. The Thaw Bar panel is shown viaorderFrontRegardless()and does not activate the app, so the platform issue is avoided. Non-fullscreen behavior is unchanged.This is the same guard the reactive sink uses, just applied to the click-driven path.
Issue Number: #740
How I tested
xcodebuild ... build, Swift 6.3.2 / Xcode 26.5, macOS 26.5.1).I could not find an existing unit/synthetic test covering this code path; happy to add one if maintainers point me at the preferred test target/fixture.
Summary by CodeRabbit