Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(110)

Unified Diff: ui/views/cocoa/native_widget_mac_nswindow.mm

Issue 1614663002: MacViews: Bubbles and dialogs behave more like sheets wrt main status (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix crash - much nicer anyway :) Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..321c2f3dea8d80e83bb6a27e08b5866645c185fd 100644
--- a/ui/views/cocoa/native_widget_mac_nswindow.mm
+++ b/ui/views/cocoa/native_widget_mac_nswindow.mm
@@ -83,9 +83,16 @@
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() && ![self parentWindow];
+}
+
+// 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

Powered by Google App Engine
This is Rietveld 408576698