fix: ensure WebContents
before checking draggable region (#41154)
fix: ensure WebContents before checking draggable region
This commit is contained in:
parent
ffec3127d5
commit
fc917985ae
1 changed files with 8 additions and 5 deletions
|
@ -81,11 +81,14 @@ void WebContentsView::SetBackgroundColor(std::optional<WrappedSkColor> color) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int WebContentsView::NonClientHitTest(const gfx::Point& point) {
|
int WebContentsView::NonClientHitTest(const gfx::Point& point) {
|
||||||
gfx::Point local_point(point);
|
if (api_web_contents_) {
|
||||||
views::View::ConvertPointFromWidget(view(), &local_point);
|
gfx::Point local_point(point);
|
||||||
SkRegion* region = api_web_contents_->draggable_region();
|
views::View::ConvertPointFromWidget(view(), &local_point);
|
||||||
if (region && region->contains(local_point.x(), local_point.y()))
|
SkRegion* region = api_web_contents_->draggable_region();
|
||||||
return HTCAPTION;
|
if (region && region->contains(local_point.x(), local_point.y()))
|
||||||
|
return HTCAPTION;
|
||||||
|
}
|
||||||
|
|
||||||
return HTNOWHERE;
|
return HTNOWHERE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue