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() {