fix: ignore draggable regions in hidden WebContentsView (#51245)

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 <shelley.vohr@gmail.com>
This commit is contained in:
trop[bot]
2026-04-22 10:35:09 -05:00
committed by GitHub
parent 04bd8fe7ba
commit 934c71daaf

View File

@@ -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)