fix(macos): Fix issue where minimized windows couldn't be restored fr… #1294
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.
Fix macOS Window Restoration from Dock When Minimized
Problem Description
On macOS, when all terminal windows are minimized to the Dock, clicking the Dock icon fails to restore these windows. Users have to manually right-click the Dock icon and select "Show All Windows" to restore minimized windows.
Root Cause
macOS's
applicationShouldHandleReopen:hasVisibleWindows:
method returnstrue
for thehas_open_windows
parameter even when all windows are minimized, causing the application to think there are visible windows and skip the restoration process.Solution
Modified the
should_handle_reopen
method inapp_delegate.rs
to not only check thehas_open_windows
parameter but also verify if there are actually visible (non-minimized) windows:has_open_windows
isfalse
has_open_windows
istrue
, iterate through all windows to check if any are visible and non-minimizedTesting Method
This fix maintains standard macOS application behavior and improves user experience.