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

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

Issue 112059: Correct the hit testing so that the window controls and title bar will get ta... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 7 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/tab_strip_view.mm
===================================================================
--- chrome/browser/cocoa/tab_strip_view.mm (revision 16871)
+++ chrome/browser/cocoa/tab_strip_view.mm (working copy)
@@ -23,4 +23,24 @@
NSRectFillUsingOperation(borderRect, NSCompositeSourceOver);
}
+// Allows this view to take clicks in background windows. Since it overlaps
+// the title bar and window buttons, it needs to do this otherwise things like
+// the close button doesn't work when the window is in the background.
+- (BOOL)acceptsFirstMouse:(NSEvent*)event {
+ return YES;
+}
+
+// Called to determine where in our view hierarchy the click should go. We
+// want clicks to go to our children (tabs, new tab button, etc), but no click
+// should ever go to this view. In fact, returning this view breaks things
+// such as the window buttons and double-clicking the title bar since the
+// window manager believes there is a view that wants the mouse event. If the
+// superclass impl says the click should go here, just cheat and return nil.
+- (NSView*)hitTest:(NSPoint)point {
+ NSView* hit = [super hitTest:point];
+ if ([hit isEqual:self])
+ hit = nil;
+ return hit;
+}
+
@end
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698