зеркало из https://github.com/electron/electron.git
fix: ensure `WebContents` before checking draggable region (#41154)
fix: ensure WebContents before checking draggable region
This commit is contained in:
Родитель
ffec3127d5
Коммит
fc917985ae
|
@ -81,11 +81,14 @@ void WebContentsView::SetBackgroundColor(std::optional<WrappedSkColor> color) {
|
|||
}
|
||||
|
||||
int WebContentsView::NonClientHitTest(const gfx::Point& point) {
|
||||
gfx::Point local_point(point);
|
||||
views::View::ConvertPointFromWidget(view(), &local_point);
|
||||
SkRegion* region = api_web_contents_->draggable_region();
|
||||
if (region && region->contains(local_point.x(), local_point.y()))
|
||||
return HTCAPTION;
|
||||
if (api_web_contents_) {
|
||||
gfx::Point local_point(point);
|
||||
views::View::ConvertPointFromWidget(view(), &local_point);
|
||||
SkRegion* region = api_web_contents_->draggable_region();
|
||||
if (region && region->contains(local_point.x(), local_point.y()))
|
||||
return HTCAPTION;
|
||||
}
|
||||
|
||||
return HTNOWHERE;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче