Skip to content

Commit

Permalink
[Mac] Fix bug where sometimes a tab's close button stays highlighted.
Browse files Browse the repository at this point in the history
The problem was caused by the fact that tracking was set to
disabled (which happens when the mouse leaves the tab strip),
which made future -checkImageState: calls early return, and
thus the button stayed highlighted.

Easiest repro steps for the bug I found (which still requires
a few tries to get right) are as follows:
  - Open exactly three tabs.
  - Close the middle tab by clicking on it's close button.
  - Right after the click move your mouse diagonally down-right,
    out of the tab strip, passing by the close button of the last
    tab which is animating into the middle tab's position.
  - On a succesful repro, your mouse is out of the tab strip, but
    the second tab's close button is now highlighted.

With this fix, the above steps do not repro the bug. Also verified
with print statements that output the flow of events.

BUG=433491
TEST=See descriptions above.

Review URL: https://codereview.chromium.org/720413004

Cr-Commit-Position: refs/heads/master@{#304319}
  • Loading branch information
asvitkine-chromium authored and Commit bot committed Nov 15, 2014
1 parent 445ae8f commit 2140408
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions ui/base/cocoa/hover_button.mm
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ - (void)setTrackingEnabled:(BOOL)enabled {
afterDelay:0];
} else {
if (trackingArea_.get()) {
self.hoverState = kHoverStateNone;
[self removeTrackingArea:trackingArea_.get()];
trackingArea_.reset(nil);
}
Expand Down

0 comments on commit 2140408

Please sign in to comment.