Commit bb0c1fde authored by Jun Mukai's avatar Jun Mukai Committed by Commit Bot

Fix client area calculation

When the draggable_regions->getBounds() has smaller width than
the widget's width, the inset decreases the top regions of the
widget but inversion is computed against draggable_regions width,
so it misses some additional client areas asides the draggable
regions.

Instead, the inversion needs to be computed against the areas
decreased by the inset.

Bug: 939094
Test: manually
Change-Id: Ia1b509b6ec5cf1ba10b44919b1da73eb03942608
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1509097
Commit-Queue: Jun Mukai <mukai@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#638709}
parent c7021cb3
......@@ -361,8 +361,12 @@ void ChromeNativeAppWindowViewsAuraAsh::UpdateDraggableRegions(
gfx::Insets insets(draggable_region->getBounds().bottom(), 0, 0, 0);
// Invert the draggable regions to determine the additional client areas.
// Inversion should be computed for the difference between the inset area
// and the draggable_region -- draggable_region->getBounds() could have
// smaller width than widget's width.
SkRegion inverted_region;
inverted_region.setRect(draggable_region->getBounds());
inverted_region.setRect(0, 0, widget()->GetWindowBoundsInScreen().width(),
draggable_region->getBounds().bottom());
inverted_region.op(*draggable_region, SkRegion::kDifference_Op);
std::vector<gfx::Rect> additional_client_regions;
for (SkRegion::Iterator i(inverted_region); !i.done(); i.next())
......
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