New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: DCHECK minimizing parent window with non-modal child #38460
Conversation
bca9121
to
31bcd81
Compare
Release Notes Persisted
|
I have automatically backported this PR to "23-x-y", please check out #38507 |
I have automatically backported this PR to "24-x-y", please check out #38508 |
I have automatically backported this PR to "25-x-y", please check out #38509 |
// save and restore it afterwards. | ||
NSInteger level = window_.level; | ||
[window_ addChildWindow:child_nswindow ordered:NSWindowAbove]; | ||
[window_ setLevel:level]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the original code, it was the child window's level that had to be restored, but here we're doing it on the parent.
This change wasn't intentional, right?
Description of Change
Closes #38459.
NativeWidgetNSWindowBridge::NotifyVisibilityChangeDown()
expects that the parent window's children have all been hidden before the window is hidden, or there is a DCHECK. This fixes that.We previously solved something similar in #29821 - however, here, we can't just detach the windows. The children need to reappear when the window becomes visible again, so we instead need to add some mechanics to hide and restore windows appropriately. I took my cue upstream from
components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm
- which has these same mechanics for similar reasons.Checklist
npm test
passesRelease Notes
Notes: Fixed potential issues when minimizing parent windows with non-modal children on macOS.