diff options
author | pinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-26 18:51:21 +0000 |
---|---|---|
committer | pinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-26 18:51:21 +0000 |
commit | c595419362d0a86f9f3e0b388da41e51d35fced2 (patch) | |
tree | d4cbf062cc74f17b5e080f27cf18b030eeb61582 /chrome/browser/cocoa/tab_strip_view.mm | |
parent | b6a8d2e866ff0bc6e6935bafe99568d0f2995470 (diff) | |
download | chromium_src-c595419362d0a86f9f3e0b388da41e51d35fced2.zip chromium_src-c595419362d0a86f9f3e0b388da41e51d35fced2.tar.gz chromium_src-c595419362d0a86f9f3e0b388da41e51d35fced2.tar.bz2 |
Correct the hit testing so that the window controls and title bar will get targeted when the window isn't the foreground window.
BUG=12505
TEST=closing and minimizing background windows. all mouse interactions with foreground tabs.
Review URL: http://codereview.chromium.org/112059
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16875 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/tab_strip_view.mm')
-rw-r--r-- | chrome/browser/cocoa/tab_strip_view.mm | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/chrome/browser/cocoa/tab_strip_view.mm b/chrome/browser/cocoa/tab_strip_view.mm index fd61766..00f74cd 100644 --- a/chrome/browser/cocoa/tab_strip_view.mm +++ b/chrome/browser/cocoa/tab_strip_view.mm @@ -23,4 +23,17 @@ NSRectFillUsingOperation(borderRect, NSCompositeSourceOver); } +// 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 |