diff options
author | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-09 16:24:26 +0000 |
---|---|---|
committer | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-09 16:24:26 +0000 |
commit | d1c95b8f5508571921f09de4f42253b2a079d59e (patch) | |
tree | 6a9a6bda90afc0e58a70138d8cc00761426cfb42 | |
parent | 2898901f661d287c78aa25f68b9c6465038884aa (diff) | |
download | chromium_src-d1c95b8f5508571921f09de4f42253b2a079d59e.zip chromium_src-d1c95b8f5508571921f09de4f42253b2a079d59e.tar.gz chromium_src-d1c95b8f5508571921f09de4f42253b2a079d59e.tar.bz2 |
Make download items less annoying by handling clicks more correctly.
BUG=21916
TEST=Download two files, click first downoad item, click second download item. Both should open, no context menu should appear.
Review URL: http://codereview.chromium.org/371060
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31432 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/cocoa/download_item_cell.mm | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/chrome/browser/cocoa/download_item_cell.mm b/chrome/browser/cocoa/download_item_cell.mm index 16b9edf..a108565 100644 --- a/chrome/browser/cocoa/download_item_cell.mm +++ b/chrome/browser/cocoa/download_item_cell.mm @@ -196,25 +196,28 @@ const int kCompleteAnimationDuration = 2.5; } // Use two distinct tracking rects for left and right parts. + // The tracking areas are also used to decide how to handle clicks. They must + // always be active, so the click is handled correctly when a download item + // is clicked while chrome is not the active app ( http://crbug.com/21916 ). NSRect bounds = [[self controlView] bounds]; NSRect buttonRect, dropdownRect; NSDivideRect(bounds, &dropdownRect, &buttonRect, kDropdownAreaWidth, NSMaxXEdge); - trackingAreaButton_.reset([[NSTrackingArea alloc] - initWithRect:buttonRect - options:(NSTrackingMouseEnteredAndExited | - NSTrackingActiveInActiveApp) - owner:self - userInfo:nil]); + trackingAreaButton_.reset([[NSTrackingArea alloc] + initWithRect:buttonRect + options:(NSTrackingMouseEnteredAndExited | + NSTrackingActiveAlways) + owner:self + userInfo:nil]); [[self controlView] addTrackingArea:trackingAreaButton_.get()]; - trackingAreaDropdown_.reset([[NSTrackingArea alloc] - initWithRect:dropdownRect - options:(NSTrackingMouseEnteredAndExited | - NSTrackingActiveInActiveApp) - owner:self - userInfo:nil]); + trackingAreaDropdown_.reset([[NSTrackingArea alloc] + initWithRect:dropdownRect + options:(NSTrackingMouseEnteredAndExited | + NSTrackingActiveAlways) + owner:self + userInfo:nil]); [[self controlView] addTrackingArea:trackingAreaDropdown_.get()]; } |