| Index: ui/views/cocoa/bridged_native_widget.mm
|
| diff --git a/ui/views/cocoa/bridged_native_widget.mm b/ui/views/cocoa/bridged_native_widget.mm
|
| index 16bf01b7b0360f689e97a2e853376936661a08c3..d4e0125716d49df204a2ff73a0446574c4832144 100644
|
| --- a/ui/views/cocoa/bridged_native_widget.mm
|
| +++ b/ui/views/cocoa/bridged_native_widget.mm
|
| @@ -571,6 +571,19 @@ NSComparisonResult SubviewSorter(NSViewComparatorValue lhs,
|
| return;
|
| }
|
|
|
| + // Non-modal windows are not animated. Hence opaque non-modal windows can
|
| + // appear with a "flash" if they are made visible before the frame from the
|
| + // compositor arrives. To get around this, set the alpha value of the window
|
| + // to 0, till we receive the correct frame from the compositor. Also, ignore
|
| + // mouse clicks till then.
|
| + // TODO(karandeepb): Investigate whether similar technique is needed for other
|
| + // dialog types.
|
| + if ([window_ isOpaque] && !native_widget_mac_->GetWidget()->IsModal()) {
|
| + initial_visibility_suppressed_ = true;
|
| + [window_ setAlphaValue:0.0];
|
| + [window_ setIgnoresMouseEvents:YES];
|
| + }
|
| +
|
| if (new_state == SHOW_AND_ACTIVATE_WINDOW) {
|
| [window_ makeKeyAndOrderFront:nil];
|
| [NSApp activateIgnoringOtherApps:YES];
|
| @@ -1100,6 +1113,12 @@ NSComparisonResult SubviewSorter(NSViewComparatorValue lhs,
|
| if (!compositor_widget_->HasFrameOfSize(GetClientAreaSize()))
|
| return;
|
|
|
| + if (initial_visibility_suppressed_) {
|
| + initial_visibility_suppressed_ = false;
|
| + [window_ setAlphaValue:1.0];
|
| + [window_ setIgnoresMouseEvents:NO];
|
| + }
|
| +
|
| if (invalidate_shadow_on_frame_swap_) {
|
| invalidate_shadow_on_frame_swap_ = false;
|
| [window_ invalidateShadow];
|
|
|