Commit c0c8e095 authored by jackhou's avatar jackhou Committed by Commit bot

[Ash] ShapedAppWindowTargeter treats empty shapes as empty hit test masks.

Previously, setShape({'rects': []}) or
setShape({'rects': [{left:0, width:0, top:0, height:1}]})
would make the window completely transparent, but still capture input.

This was because ShapedAppWindowTargeter::GetHitTestMask returned
false if the shape was empty. It now returns false only if the shape
is NULL.

BUG=417014

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

Cr-Commit-Position: refs/heads/master@{#296975}
parent 6e3ab0a5
......@@ -18,5 +18,9 @@ ShapedAppWindowTargeter::~ShapedAppWindowTargeter() {
bool ShapedAppWindowTargeter::GetHitTestMask(aura::Window* window,
gfx::Path* mask) const {
SkRegion* shape = app_window_->shape();
return shape ? shape->getBoundaryPath(mask) : false;
if (!shape)
return false;
shape->getBoundaryPath(mask);
return true;
}
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