From e105d66074bee2a4b4c033793713d0736d187965 Mon Sep 17 00:00:00 2001 From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> Date: Wed, 22 Apr 2026 10:34:59 -0500 Subject: [PATCH] fix: ignore draggable regions in hidden `WebContentsView` (#51246) fix: ignore draggable regions in hidden WebContentsView Hidden child WebContentsViews were still contributing their draggable regions to the parent window's non-client hit test, so clicks in the area where a hidden view's draggable element would render still dragged the window. Early-return HTNOWHERE when the view is not visible. Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr --- shell/browser/api/electron_api_web_contents_view.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/shell/browser/api/electron_api_web_contents_view.cc b/shell/browser/api/electron_api_web_contents_view.cc index 8077049737..77670cbf0a 100644 --- a/shell/browser/api/electron_api_web_contents_view.cc +++ b/shell/browser/api/electron_api_web_contents_view.cc @@ -82,6 +82,8 @@ void WebContentsView::ApplyBorderRadius() { } int WebContentsView::NonClientHitTest(const gfx::Point& point) { + if (!view() || !view()->GetVisible()) + return HTNOWHERE; if (api_web_contents_) { auto* iwc = api_web_contents_->inspectable_web_contents(); if (!iwc)