Commit 0c169fe7 authored by jackhou's avatar jackhou Committed by Commit bot

[Mac] Restore the Chrome main menu if there are no windows on the active space.

When an app window closes, we skip restoring the Chrome main menu if
there are other windows to minimize the number of times the main menu is
changed. This doesn't work if the other windows are on different spaces.
This ensures the Chrome menu is restored if there are no other windows
on the active space.

BUG=467323

Review URL: https://codereview.chromium.org/1024363002

Cr-Commit-Position: refs/heads/master@{#322495}
parent a7927193
......@@ -398,7 +398,7 @@ void SetItemWithTagVisible(NSMenuItem* top_level_item,
// will be changed when another window becomes main. Otherwise, restore the
// Chrome menu.
for (NSWindow* w : [NSApp windows]) {
if ([w canBecomeMainWindow] && ![w isEqual:window])
if ([w canBecomeMainWindow] && ![w isEqual:window] && [w isOnActiveSpace])
return;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment