| Index: chrome/browser/ui/cocoa/chrome_browser_window.mm
|
| diff --git a/chrome/browser/ui/cocoa/chrome_browser_window.mm b/chrome/browser/ui/cocoa/chrome_browser_window.mm
|
| index 4f12cda64c98aba999a2426561aefb03589afbcf..e9894b36ce691eeb6445bb8c4415253452c16b99 100644
|
| --- a/chrome/browser/ui/cocoa/chrome_browser_window.mm
|
| +++ b/chrome/browser/ui/cocoa/chrome_browser_window.mm
|
| @@ -9,6 +9,10 @@
|
| #import "chrome/browser/ui/cocoa/themed_window.h"
|
| #include "ui/base/theme_provider.h"
|
|
|
| +@interface NSWindow (Private)
|
| +- (BOOL)hasKeyAppearance;
|
| +@end
|
| +
|
| @implementation ChromeBrowserWindow
|
|
|
| - (const ui::ThemeProvider*)themeProvider {
|
| @@ -80,4 +84,22 @@
|
| return NO;
|
| }
|
|
|
| +- (BOOL)hasKeyAppearance {
|
| + // If not key, but a non-main child window without its own traffic lights _is_
|
| + // key, then show this window with key appearance to keep the traffic lights
|
| + // lit. This does not currently handle WebModal dialogs, since they are
|
| + // children of an overlay window. But WebModals also temporarily lose key
|
| + // status while animating closed, so extra logic is needed to avoid flicker.
|
| + // Start with an early exit, since this is called for every mouseMove and
|
| + // every cursor blink in an NSTextField.
|
| + if (![self isKeyWindow]) {
|
| + for (NSWindow* child in [self childWindows]) {
|
| + if ([child isKeyWindow] && ![child isMainWindow] &&
|
| + ([child styleMask] & NSClosableWindowMask) == 0)
|
| + return YES;
|
| + }
|
| + }
|
| + return [super hasKeyAppearance];
|
| +}
|
| +
|
| @end
|
|
|