Commit 5e66209f authored by Sidney San Martín's avatar Sidney San Martín Committed by Commit Bot

Fix toolbar hiding while the mouse is still over it when the system uses a dark menu bar.

FullscreenToolbarMouseTracker has a method, -updateToolbarFrame:, which
sets trackingAreaFrame_ based on contentView_'s bounds, then calls
-updateTrackingArea. However, -updateTrackingArea is responsible for
setting contentView_, so its value is stale (nil, in this case) when
-updateToolbarFrame: looks at it.

trackingAreaFrame_ only becomes correct if -updateToolbarFrame: is
called a second time. I haven't discovered why, but it looks like we get
extra events from the light menu bar, but not the dark one, which masked
the bug.

Fix the bug by having -updateToolbarFrame: find the content view itself
instead of relying on the contentView_ ivar (which seems to mainly be
used to remember which view currently has a tracking area).

Bug: 749224
Change-Id: I3c923d09590e3416ebcf8bbb428d1dd44f62fab7
Reviewed-on: https://chromium-review.googlesource.com/627296
Commit-Queue: Sidney San Martín <sdy@chromium.org>
Reviewed-by: default avatarSarah Chan <spqchan@chromium.org>
Reviewed-by: default avatarTrent Apted <tapted@chromium.org>
Cr-Commit-Position: refs/heads/master@{#496574}
parent 033b3d69
......@@ -88,7 +88,8 @@ initWithFullscreenToolbarController:(FullscreenToolbarController*)owner
}
- (void)updateToolbarFrame:(NSRect)frame {
NSRect contentBounds = [contentView_ bounds];
NSRect contentBounds =
[[[[owner_ browserWindowController] window] contentView] bounds];
trackingAreaFrame_ = frame;
trackingAreaFrame_.origin.y -= kTrackingAreaAdditionalThreshold;
trackingAreaFrame_.size.height =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment