Index: ui/views/cocoa/native_widget_mac_nswindow.mm |
diff --git a/ui/views/cocoa/native_widget_mac_nswindow.mm b/ui/views/cocoa/native_widget_mac_nswindow.mm |
index 678e4d58440a13fb33614e264dc17c22c36afed9..4acbd946877d34fb72ef43e079333fb492bb95d6 100644 |
--- a/ui/views/cocoa/native_widget_mac_nswindow.mm |
+++ b/ui/views/cocoa/native_widget_mac_nswindow.mm |
@@ -5,6 +5,7 @@ |
#import "ui/views/cocoa/native_widget_mac_nswindow.h" |
#include "base/mac/foundation_util.h" |
+#import "ui/views/cocoa/bridged_native_widget.h" |
#import "ui/base/cocoa/user_interface_item_command_handler.h" |
#import "ui/views/cocoa/views_nswindow_delegate.h" |
#include "ui/views/controls/menu/menu_controller.h" |
@@ -83,9 +84,17 @@ |
if (![self delegate]) |
return NO; |
- // Dialogs shouldn't take large shadows away from their parent window. |
+ // Dialogs and bubbles shouldn't take large shadows away from their parent. |
views::Widget* widget = [self viewsWidget]; |
- return widget->CanActivate() && !widget->IsDialogBox(); |
+ return widget->CanActivate() && |
+ !views::NativeWidgetMac::GetBridgeForNativeWindow(self)->parent(); |
+} |
+ |
+// Lets the traffic light buttons on the parent window keep their active state. |
+- (BOOL)_sharesParentKeyState { |
+ // Follow -canBecomeMainWindow unless the window provides its own buttons. |
+ return ([self styleMask] & NSClosableWindowMask) == 0 && |
+ ![self canBecomeMainWindow]; |
} |
// Override sendEvent to allow key events to be forwarded to a toolkit-views |