From c06c7439df745ff71768322a002cc67841c54997 Mon Sep 17 00:00:00 2001 From: Nik Pavlov Date: Mon, 16 Sep 2024 09:05:42 +0000 Subject: [PATCH] Account for overlay host Widget in CefWidget::GetForWidget (fixes #3784) --- libcef/browser/views/widget.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libcef/browser/views/widget.cc b/libcef/browser/views/widget.cc index f85b94f90..27c073bb8 100644 --- a/libcef/browser/views/widget.cc +++ b/libcef/browser/views/widget.cc @@ -42,6 +42,9 @@ CefWidget* CefWidget::GetForWidget(views::Widget* widget) { if (auto window = view_util::GetWindowFor(widget)) { if (auto* window_view = static_cast(window.get())->cef_window_view()) { + if (auto widget_view = view_util::GetHostView(widget)) { + widget = widget_view->GetWidget(); + } if (window_view->IsChromeStyle()) { return static_cast(widget); }