Skip to content

Conversation

188
Copy link

@188 188 commented Sep 6, 2025

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 returns true for the has_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 in app_delegate.rs to not only check the has_open_windows parameter but also verify if there are actually visible (non-minimized) windows:

  1. Maintained existing logic when has_open_windows is false
  2. When has_open_windows is true, iterate through all windows to check if any are visible and non-minimized
  3. If all windows are minimized (no visible windows), trigger the window restoration process

Testing Method

  1. Open the Rio terminal application
  2. Minimize all windows to the Dock
  3. Click the Dock icon
  4. Verify that all windows are properly restored

This fix maintains standard macOS application behavior and improves user experience.

…om Dock

When all windows are minimized to the Dock on macOS, the `applicationShouldHandleReopen:hasVisibleWindows:` method's `has_open_windows` parameter remains true, preventing window restoration.

This fix checks for visible (non-minimized) windows to determine whether restoration is needed, ensuring that clicking the Dock icon properly restores windows when all are minimized.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant