Repository navigation
fix(tabs): open files as tabs in full screen and Split View - #36
Merged
Merged
Conversation
Opening a file while QuickMD was in full screen or Split View gave the tab group a full-screen Space of its own: the Split View broke, half the screen was black and the menu bar could not be revealed. WindowConfigurator's callback runs only after the new window is on screen (and, in full screen, already in a Space of its own), so its late addTabbedWindow moved a window mid-transition. It also renamed every window's tabbingIdentifier, so AppKit's own tabbing (on by default in full screen) never matched the new window to the existing one. - Keep SwiftUI's shared tabbingIdentifier and set AppleWindowTabbingMode to "always" in the argument domain at launch (QuickMD only, not persisted): AppKit tabs each new window as it is ordered in. - Manual merge is a fallback for ordinary windows only; a window AppKit already tabbed is not resized. - WindowSizeMemory ignores full-screen windows, so a Split View half is no longer remembered as the size for new windows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
|
Thank you, @onemannoplan - great diagnosis, and the write-up made it easy to verify. Merged into main, together with one follow-up commit (26fa99b):
Checked on a separate build on macOS 27: on the old main, opening a second file in full screen created a second full-screen Space; with your fix it lands as a tab in the same Space. A Settings window opened next to the documents stays a separate window. I could not test Split View on this Mac, because "Displays have separate Spaces" is off here and macOS does not offer Split View without it. It goes out in the next release. |
Owner
|
Shipped in v1.13.0: https://github.com/b451c/quickmd/releases/tag/v1.13.0 (also on Homebrew). Thanks again, @onemannoplan! |
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.
Problem
With QuickMD in full screen or Split View (e.g. QuickMD on the left half, Finder on the right), opening another file did not add a tab in place. The tab group was moved into a new full-screen Space of its own: the Split View broke, the window kept its half width with the other half of the screen black, and the menu bar could not be revealed.
Cause
Two things together:
WindowConfigurator's callback runs only after the new window is already on screen. In full screen, the window has already started getting its own Space by then. The lateaddTabbedWindowmoved it into the existing tab group mid-transition.tabbingIdentifier, also after the window appeared. SwiftUI already gives all DocumentGroup windows one shared identifier, so AppKit's own tabbing would have handled this (the system default, "Prefer tabs: In Full Screen", tabs new windows in place). But the renamed host never matched the new window, so AppKit gave the new window a Space of its own instead.Fix
tabbingIdentifier, and setAppleWindowTabbingModetoalwaysin the argument domain at launch (WindowTabbing.preferTabsAlways()). This applies to QuickMD only and is never written to disk, so the user's system setting is untouched. AppKit then tabs each new window as it is ordered in, whether or not the app is in full screen. This matches the app's stated intent of tabs regardless of the system setting.WindowSizeMemoryno longer resizes the tab group.WindowSizeMemoryignores full-screen windows. Before this, a Split View half (1534 × 1920 here) was saved as the size for later standalone windows.Testing
WindowTabbingTests(14 tests): AppKit reports.alwaysafterpreferTabsAlways(), other launch arguments are kept and nothing is persisted, the merge decisions, and size memory skipping full-screen windows.