Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: draggable regions in BrowserViews are independent #31198

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 7 additions & 5 deletions shell/browser/api/electron_api_browser_window_mac.mm
Expand Up @@ -39,10 +39,7 @@

void BrowserWindow::UpdateDraggableRegions(
const std::vector<mojom::DraggableRegionPtr>& regions) {
if (window_->has_frame())
return;

if (!web_contents())
if (window_->has_frame() || !web_contents())
return;

// All ControlRegionViews should be added as children of the WebContentsView,
Expand Down Expand Up @@ -78,8 +75,13 @@
DraggableRegionsToSkRegion(regions), webViewWidth, webViewHeight);
}

// Draggable regions on BrowserViews are independent from those of
// BrowserWindows, so if a BrowserView with different draggable regions than
// the BrowserWindow it belongs to is superimposed on top of that window, the
// draggable regions of the BrowserView take precedence over those of the
// BrowserWindow.
for (NativeBrowserView* view : window_->browser_views()) {
view->UpdateDraggableRegions(drag_exclude_rects);
view->UpdateDraggableRegions(view->GetDraggableRegions());
}

// Create and add a ControlRegionView for each region that needs to be
Expand Down