Commit ecf6e73f authored by Allen Bauer's avatar Allen Bauer Committed by Commit Bot

Don't blindly overwrite the |hovered_tab| without painting the current one first.

There are issues here that manifested differently. They where all caused by
the same core issue. Since the tabs overlap visually, two tabs can report as
being hovered so make sure the |hovered_tab| variable isn't blindly overwritten
without first making sure it's painted.

Bug: 853240
Bug: 854371
Change-Id: I62643659c6416cb23637613d0c3da83c6f4605f2
Reviewed-on: https://chromium-review.googlesource.com/1108338
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#568950}
parent 70d4eec0
...@@ -1177,7 +1177,12 @@ void TabStrip::PaintChildren(const views::PaintInfo& paint_info) { ...@@ -1177,7 +1177,12 @@ void TabStrip::PaintChildren(const views::PaintInfo& paint_info) {
if (!tab->IsSelected()) { if (!tab->IsSelected()) {
if (!stacked_layout_) { if (!stacked_layout_) {
// In Refresh mode, defer the painting of the hovered tab to below. // In Refresh mode, defer the painting of the hovered tab to below.
if (MD::IsRefreshUi() && tab->IsMouseHovered() && !hovered_tab) { if (MD::IsRefreshUi() && tab->IsMouseHovered()) {
// Since two adjacent tabs overlap, they can both return as being
// hovered. Favor the left-most tab by ensuring the current
// |hovered_tab| is painted before assigning from |tab|.
if (hovered_tab)
hovered_tab->Paint(paint_info);
hovered_tab = tab; hovered_tab = tab;
} else { } else {
tab->Paint(paint_info); tab->Paint(paint_info);
......
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