| Index: components/constrained_window/native_web_contents_modal_dialog_manager_views_mac.mm
|
| diff --git a/components/constrained_window/native_web_contents_modal_dialog_manager_views_mac.mm b/components/constrained_window/native_web_contents_modal_dialog_manager_views_mac.mm
|
| index 5df747e7ecef4bb8ac1c193e4cdd0835d64b641e..aafe789f935296b8f395fa6d4ad68b26bfcb5ba4 100644
|
| --- a/components/constrained_window/native_web_contents_modal_dialog_manager_views_mac.mm
|
| +++ b/components/constrained_window/native_web_contents_modal_dialog_manager_views_mac.mm
|
| @@ -21,14 +21,25 @@ namespace {
|
|
|
| // Sets visibility and mouse events for a Cocoa NSWindow* and an attached sheet.
|
| void SetSheetVisible(gfx::NativeWindow overlay, bool visible) {
|
| - CGFloat alpha = visible ? 1.0 : 0.0;
|
| BOOL ignore_events = visible ? NO : YES;
|
|
|
| // Don't allow interaction with the tab underneath the overlay.
|
| [overlay setIgnoresMouseEvents:ignore_events];
|
|
|
| - [[overlay attachedSheet] setAlphaValue:alpha];
|
| + [[overlay attachedSheet] setAlphaValue:visible ? 1.0 : 0.0];
|
| [[overlay attachedSheet] setIgnoresMouseEvents:ignore_events];
|
| +
|
| + if (visible) {
|
| + // When showing the sheet, re-order the overlay and sheet to be on top of
|
| + // any other sheet/overlay pairs which may be open at the same time. Without
|
| + // doing this, the sheet and overlay become obscured behind overlays for
|
| + // other sheets, which block mouse events intended for the current sheet.
|
| + NSWindow* parent = [overlay parentWindow];
|
| + [parent removeChildWindow:overlay];
|
| + [parent addChildWindow:overlay ordered:NSWindowAbove];
|
| + [overlay removeChildWindow:[overlay attachedSheet]];
|
| + [overlay addChildWindow:[overlay attachedSheet] ordered:NSWindowAbove];
|
| + }
|
| }
|
|
|
| } // namespace
|
|
|