From 0a627230ac66addd009edd75acc48b79e3faa544 Mon Sep 17 00:00:00 2001 From: Nik Pavlov Date: Tue, 15 Oct 2024 18:28:13 +0000 Subject: [PATCH] views: Fix overlay bounds outside of window (fixes #3457) --- libcef/browser/views/overlay_view_host.cc | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/libcef/browser/views/overlay_view_host.cc b/libcef/browser/views/overlay_view_host.cc index eb3793acc..702e974e1 100644 --- a/libcef/browser/views/overlay_view_host.cc +++ b/libcef/browser/views/overlay_view_host.cc @@ -280,18 +280,17 @@ void CefOverlayViewHost::SetOverlayBounds(const gfx::Rect& bounds) { return; } - gfx::Rect new_bounds = bounds; - - // Keep the result inside the widget. - new_bounds.Intersect(window_view_->bounds()); - - if (new_bounds == bounds_) { + // Empty bounds are not allowed. + if (bounds.IsEmpty()) { return; } bounds_changing_ = true; + bounds_ = bounds; + + // Keep the result inside the widget. + bounds_.Intersect(window_view_->bounds()); - bounds_ = new_bounds; if (view_->size() != bounds_.size()) { view_->SetSize(bounds_.size()); }