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

Unified Diff: chrome/browser/ui/cocoa/fast_resize_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 | « no previous file | chrome/browser/ui/cocoa/tabs/tab_strip_view.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/fast_resize_view.mm
diff --git a/chrome/browser/ui/cocoa/fast_resize_view.mm b/chrome/browser/ui/cocoa/fast_resize_view.mm
index b5bfb1eabe4908c8c91f0841c98e448e8f0a4b8f..82c0b7228948ba36cde11eeef4c6fc4e66babd4e 100644
--- a/chrome/browser/ui/cocoa/fast_resize_view.mm
+++ b/chrome/browser/ui/cocoa/fast_resize_view.mm
@@ -27,5 +27,14 @@
return YES;
}
+// Override -[NSView hitTest:] to prevent mouse events reaching subviews while
+// the window is displaying a modal sheet. Without this, context menus can be
+// shown on a right-click and trigger all kinds of things (e.g. Print).
+- (NSView*)hitTest:(NSPoint)aPoint {
+ if ([[self window] attachedSheet])
+ return self;
+ return [super hitTest:aPoint];
+}
+
@end
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/tabs/tab_strip_view.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698