Commit 60b9ce1a authored by Dana Fried's avatar Dana Fried Committed by Commit Bot

Ensure Mac exit fullscreen prompt is correctly placed.

Bug was uncovered by fixing another bug that caused repeated, expensive
browser layouts. Because the browser wasn't constantly laying out, the
"Press %^F to exit fullscreen" prompt did not have its position
immediately updated on being shown, and was using a stale position
calculated before the browser moved to fullscreen.

This was exacerbated on Mac by the fact that showing windows is
asynchronous, so while on other platforms there was a layout pass as the
browser was resized to fullscreen that repositioned the window, an
explicit visibility check on Mac failed and that code was never run,
plus the fact that the zoom-to-fullscreen animation on the Mac is fairly
slow.

This CL changes the logic (on Mac only) so that the position of the
"toast" bubble is updated even if the widget is not yet visible, as long
as the animation is playing or has played towards the "shown" state
(i.e. the value of the SlideAnimation is greater than zero).

Bug: 1122467
Change-Id: I0a962b52d7a7531dc7bc77748efc82877b62d05b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2389263Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Commit-Queue: Dana Fried <dfried@chromium.org>
Cr-Commit-Position: refs/heads/master@{#803969}
parent a3c87092
......@@ -156,7 +156,16 @@ void ExclusiveAccessBubbleViews::UpdateContent(
}
void ExclusiveAccessBubbleViews::RepositionIfVisible() {
#if defined(OS_MAC)
// Due to a quirk on the Mac, the popup will not be visible for a short period
// of time after it is shown (it's asynchronous) so if we don't check the
// value of the animation we'll have a stale version of the bounds when we
// show it and it will appear in the wrong place - typically where the window
// was located before going to fullscreen.
if (popup_->IsVisible() || animation_->GetCurrentValue() > 0.0)
#else
if (popup_->IsVisible())
#endif
UpdateBounds();
}
......
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