Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 23 additions & 3 deletions rio-window/src/platform_impl/macos/app_delegate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,29 @@ declare_class!(
_sender: Option<&AnyObject>,
has_open_windows: bool,
) -> bool {
if self.is_launched() && !has_open_windows {
self.dispatch_application_reopen();
true
if self.is_launched() {
// Check if there are open windows but all windows are minimized
if !has_open_windows {
self.dispatch_application_reopen();
true
} else {
let mtm = MainThreadMarker::from(self);
let app = NSApplication::sharedApplication(mtm);

// Check if there are visible windows
let windows = app.windows();
let has_visible_window = windows.iter().any(|window| {
window.isVisible() && !window.isMiniaturized()
});

// If there are no visible windows (all windows are minimized), restore the windows
if !has_visible_window {
self.dispatch_application_reopen();
true
} else {
false
}
}
} else {
false
}
Expand Down
Loading