From dc58761a107d4a538da4c2ae57fc73ba6f8e4590 Mon Sep 17 00:00:00 2001 From: Mitchell Cohen Date: Fri, 1 May 2026 13:29:22 -0400 Subject: [PATCH] =?UTF-8?q?fix:=20prevent=20borders=20and=20smearing=20in?= =?UTF-8?q?=20transparent=20frameless/client=20fra=E2=80=A6=20(#51430)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix: prevent borders and smearing in transparent frameless/client frame windows on Linux (#50541) fix the appearance of transparent frameless and client frame windows --- .../ui/electron_desktop_window_tree_host_linux.cc | 4 +++- shell/browser/ui/views/opaque_frame_view.cc | 11 ++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/shell/browser/ui/electron_desktop_window_tree_host_linux.cc b/shell/browser/ui/electron_desktop_window_tree_host_linux.cc index 8ab650e016..9ef0894da9 100644 --- a/shell/browser/ui/electron_desktop_window_tree_host_linux.cc +++ b/shell/browser/ui/electron_desktop_window_tree_host_linux.cc @@ -239,7 +239,9 @@ void ElectronDesktopWindowTreeHostLinux::UpdateFrameHints() { if (ui::OzonePlatform::GetInstance()->IsWindowCompositingSupported()) { // Set the opaque region. std::vector opaque_region; - if (IsShowingFrame(window_state)) { + if (native_window_view_->IsTranslucent()) { + // Leave opaque_region empty. + } else if (IsShowingFrame(window_state)) { // The opaque region is a list of rectangles that contain only fully // opaque pixels of the window. We need to convert the clipping // rounded-rect into this format. diff --git a/shell/browser/ui/views/opaque_frame_view.cc b/shell/browser/ui/views/opaque_frame_view.cc index b87530729e..735912b9f0 100644 --- a/shell/browser/ui/views/opaque_frame_view.cc +++ b/shell/browser/ui/views/opaque_frame_view.cc @@ -203,6 +203,12 @@ void OpaqueFrameView::OnPaint(gfx::Canvas* canvas) { if (frame()->IsFullscreen()) return; + if (window()->IsWindowControlsOverlayEnabled()) + UpdateFrameCaptionButtons(); + + if (window()->IsTranslucent()) + return; + const bool active = ShouldPaintAsActive(); const gfx::Insets border = FrameBorderInsets(false); const bool showing_shadow = linux_frame_layout_->IsShowingShadow(); @@ -228,11 +234,6 @@ void OpaqueFrameView::OnPaint(gfx::Canvas* canvas) { ::PaintRestoredFrameBorderLinux(*canvas, *this, frame_background_.get(), clip, showing_shadow, active, border, shadow_values, linux_frame_layout_->tiled()); - - if (!window()->IsWindowControlsOverlayEnabled()) - return; - - UpdateFrameCaptionButtons(); } void OpaqueFrameView::PaintAsActiveChanged() {