|
@@ -51,10 +51,22 @@ using FullScreenTransitionState =
|
|
|
|
|
|
// check occlusion binary flag
|
|
|
if (window.occlusionState & NSWindowOcclusionStateVisible) {
|
|
|
- // The app is visible
|
|
|
+ // There's a macOS bug where if a child window is minimized, and then both
|
|
|
+ // windows are restored via activation of the parent window, the child
|
|
|
+ // window is not properly deminiaturized. This causes traffic light bugs
|
|
|
+ // like the close and miniaturize buttons having no effect. We need to call
|
|
|
+ // deminiaturize on the child window to fix this. Unfortunately, this also
|
|
|
+ // hits ANOTHER bug where even after calling deminiaturize,
|
|
|
+ // windowDidDeminiaturize is not posted on the child window if it was
|
|
|
+ // incidentally restored by the parent, so we need to manually reset
|
|
|
+ // is_minimized_ here.
|
|
|
+ if (shell_->parent() && is_minimized_) {
|
|
|
+ shell_->Restore();
|
|
|
+ is_minimized_ = false;
|
|
|
+ }
|
|
|
+
|
|
|
shell_->NotifyWindowShow();
|
|
|
} else {
|
|
|
- // The app is not visible
|
|
|
shell_->NotifyWindowHide();
|
|
|
}
|
|
|
}
|
|
@@ -244,11 +256,15 @@ using FullScreenTransitionState =
|
|
|
|
|
|
- (void)windowDidMiniaturize:(NSNotification*)notification {
|
|
|
[super windowDidMiniaturize:notification];
|
|
|
+ is_minimized_ = true;
|
|
|
+
|
|
|
shell_->NotifyWindowMinimize();
|
|
|
}
|
|
|
|
|
|
- (void)windowDidDeminiaturize:(NSNotification*)notification {
|
|
|
[super windowDidDeminiaturize:notification];
|
|
|
+ is_minimized_ = false;
|
|
|
+
|
|
|
shell_->AttachChildren();
|
|
|
shell_->SetWindowLevel(level_);
|
|
|
shell_->NotifyWindowRestore();
|