Chromium Code Reviews| Index: ui/views/cocoa/widget_owner_nswindow_adapter.mm |
| diff --git a/ui/views/cocoa/widget_owner_nswindow_adapter.mm b/ui/views/cocoa/widget_owner_nswindow_adapter.mm |
| index 5259c7e25b209c1288fc77dd7e7c171cba41fa78..b40ea57f523cfa5353fe51c5b4e5e388a8e34349 100644 |
| --- a/ui/views/cocoa/widget_owner_nswindow_adapter.mm |
| +++ b/ui/views/cocoa/widget_owner_nswindow_adapter.mm |
| @@ -102,7 +102,11 @@ void WidgetOwnerNSWindowAdapter::OnWindowDidChangeOcclusionState() { |
| return; |
| if (child_->window_visible()) { |
| - DCHECK([child_->ns_window() parentWindow]); |
| + // A sheet should never have a parentWindow, otherwise dismissing the sheet |
| + // causes graphical glitches (http://crbug.com/605098). Non-sheets should |
| + // always have a parentWindow. |
| + DCHECK([child_->ns_window() isSheet] != |
|
karandeepb
2016/11/28 05:19:32
So this was/is slightly confusing. Is this correct
tapted
2016/11/28 06:15:41
yes. ([NSWindow parentWindow] should be nil -- but
karandeepb
2016/11/28 23:37:57
Acknowledged.
|
| + !![child_->ns_window() parentWindow]); |
| DCHECK(child_->wants_to_be_visible()); |
| return; |
| } |
| @@ -115,8 +119,8 @@ void WidgetOwnerNSWindowAdapter::OnWindowDidChangeOcclusionState() { |
| [child_->ns_window() orderWindow:NSWindowAbove |
| relativeTo:[anchor_window_ windowNumber]]; |
| - // Ordering the window should add back the relationship. |
| - DCHECK([child_->ns_window() parentWindow]); |
| + // Ordering the window should add back the relationship (unless it's a sheet). |
| + DCHECK([child_->ns_window() isSheet] != !![child_->ns_window() parentWindow]); |
| DCHECK(child_->window_visible()); |
| } |