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

Unified Diff: chrome/browser/ui/cocoa/tabs/tab_strip_view.mm

Issue 1354873002: Mac: Prevent mouse events reaching subviews while a window has an attached Sheet (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: TabView menu check now obsolete Created 4 years, 6 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
« no previous file with comments | « chrome/browser/ui/cocoa/fast_resize_view.mm ('k') | chrome/browser/ui/cocoa/tabs/tab_view.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/tabs/tab_strip_view.mm
diff --git a/chrome/browser/ui/cocoa/tabs/tab_strip_view.mm b/chrome/browser/ui/cocoa/tabs/tab_strip_view.mm
index 8334d31dd830815a074bd3be78df351dac30b8f8..dc227e56e4e76733f81230e85a5cba4c13071a20 100644
--- a/chrome/browser/ui/cocoa/tabs/tab_strip_view.mm
+++ b/chrome/browser/ui/cocoa/tabs/tab_strip_view.mm
@@ -227,6 +227,17 @@
return YES;
}
+// When displaying a modal sheet, interaction with the tabs (e.g. middle-click
+// to close a tab) should be blocked. -[NSWindow sendEvent] blocks left-click,
+// but not others. To prevent clicks going to subviews, absorb them here. This
+// is also done in FastResizeView, but TabStripView is in the title bar, so is
+// not contained in a FastResizeView.
+- (NSView*)hitTest:(NSPoint)aPoint {
+ if ([[self window] attachedSheet])
+ return self;
+ return [super hitTest:aPoint];
+}
+
// Trap double-clicks and make them miniaturize the browser window.
- (void)mouseUp:(NSEvent*)event {
// Bail early if double-clicks are disabled.
« no previous file with comments | « chrome/browser/ui/cocoa/fast_resize_view.mm ('k') | chrome/browser/ui/cocoa/tabs/tab_view.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698