Repository navigation
Fix macOS fullscreen hide, always-on-top fullscreen level, and SetFullScreenable - #99
Merged
Merged
Conversation
Drop the cached kWindowAlwaysOnTopKey associated object so direct native NSWindow.level changes after SetAlwaysOnTop(false) are still reflected by IsAlwaysOnTop() and reported by WindowPropertyChangedEvent. Only treat restore_always_on_top as overriding the window level while suspended for native fullscreen, and guard repeated Hide() calls in fullscreen from toggling twice.
10 tasks done
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.
Refs #80
Summary
Addresses the reproducible macOS window lifecycle bugs from #80:
Hide()in fullscreen (leanflutter/window_manager#379): WhenIsFullScreen()is true,Window::Hide()now exits native fullscreen viatoggleFullScreen:first and deferssetIsVisible:NO/orderOut:untilNSWindowDidExitFullScreenNotification, avoiding leaving the user stuck on a black fullscreen Space. CallingShow()orShowInactive()before exit completes cancels the pending hide.AlwaysOnTop+ fullscreen (leanflutter/window_manager#351): Track the requested always-on-top policy on theNSWindowand suspendNSFloatingWindowLevelback toNSNormalWindowLevelacross native fullscreen (both programmaticSetFullScreen(true)and user-initiatedNSWindowWillEnterFullScreenNotification) so macOS hides the menu bar and Dock properly, restoringNSFloatingWindowLevelonNSWindowDidExitFullScreenNotification.SetFullScreenable()/IsFullScreenable(): ImplementSetFullScreenable()viacollectionBehavior(NSWindowCollectionBehaviorFullScreenPrimary/NSWindowCollectionBehaviorFullScreenNone) and fixIsFullScreenable()(which previously checkedNSWindowStyleMaskFullScreen, i.e.IsFullScreen()).tests/window_lifecycle_macos_test.mmcovering deferred fullscreen hide + cancellation, always-on-top level suspension/restoration across fullscreen,SetFullScreenable(),SetResizable()round-trip (#462), and top-edge button hit-testing underTitleBarStyle::Hiddenon macOS 27.2 (#565).Audit of remaining #80 items on macOS 27.2
#565(hidden title bar top clicks):NativeApiUpdateWindowMovabledisables system drag on hidden title bar; verified top-edgeNSButtonhit-tests directly toNSButtonon macOS 27.2.#171(bar blocking top in fullscreen):nativeapidoes not inject anNSToolbar; usesNSWindowStyleMaskFullSizeContentView+ transparent title bar.#462(setResizable): verified round-trip with both normal and hidden title bars.#543(hide from hotkey callback):shortcut_manager_macos.mmdelivers Carbon hotkeys on the main thread.#541(setSizehang in tests):Window::SetSizeis synchronous (setFrame:display:YES) and never blocks on an animation completion callback.#481(transparent background black):Window::SetBackgroundColorupdatesFlutterViewController.backgroundColorviaNativeApiContentWithBackground.#360(freeze after hot restart in fullscreen):Window::SetFullScreen(true)is a no-op whenIsFullScreen()is already true and never blocks.Verification
coreand ran fullctestsuite on macOS 27.2: 40/40 tests passed.