fix: don't unnecessarily copy draggable regions (#21704)

This commit is contained in:
CezaryKulakowski 2020-01-09 21:13:28 +01:00 committed by Jeremy Apthorp
parent 768a6ace1b
commit f461dc7002

View file

@ -101,9 +101,11 @@ void BrowserWindow::UpdateDraggableRegions(
// Draggable regions is implemented by having the whole web view draggable
// (mouseDownCanMoveWindow) and overlaying regions that are not draggable.
if (&draggable_regions_ != &regions) {
draggable_regions_.clear();
for (const auto& r : regions)
draggable_regions_.push_back(r.Clone());
}
std::vector<gfx::Rect> drag_exclude_rects;
if (regions.empty()) {
drag_exclude_rects.push_back(gfx::Rect(0, 0, webViewWidth, webViewHeight));