From 1a97a28b0f946d83d3d8da5d4c2f3b73295a8331 Mon Sep 17 00:00:00 2001 From: Chris Frank Date: Tue, 6 Jun 2023 12:33:52 +0000 Subject: [PATCH] linux: alloy: Fix window resize after context menu dismissal (fixes #3466) --- libcef/browser/native/window_x11.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/libcef/browser/native/window_x11.cc b/libcef/browser/native/window_x11.cc index ad76d181b..211330bc5 100644 --- a/libcef/browser/native/window_x11.cc +++ b/libcef/browser/native/window_x11.cc @@ -127,6 +127,7 @@ CefWindowX11::CefWindowX11(CefRefPtr browser, /*visual_has_alpha=*/nullptr); xwindow_ = connection_->GenerateId(); + connection_->CreateWindow({ .depth = depth, .wid = xwindow_, @@ -140,12 +141,15 @@ CefWindowX11::CefWindowX11(CefRefPtr browser, .background_pixel = 0, .border_pixel = 0, .override_redirect = x11::Bool32(false), - .event_mask = x11::EventMask::FocusChange | - x11::EventMask::StructureNotify | - x11::EventMask::PropertyChange, .colormap = colormap, }); + auto event_mask = x11::EventMask::FocusChange | + x11::EventMask::StructureNotify | + x11::EventMask::PropertyChange; + xwindow_events_ = + std::make_unique(xwindow_, event_mask); + connection_->Flush(); DCHECK(ui::X11EventSource::HasInstance());