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

This commit is contained in:
trop[bot]
2020-01-10 09:09:26 -08:00
committed by Shelley Vohr
parent fa7326af64
commit 2c92573978

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.
draggable_regions_.clear();
for (const auto& r : regions)
draggable_regions_.push_back(r.Clone());
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));