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 |