fix: prevent borders and smearing in transparent frameless/client fra… (#51430)

fix: prevent borders and smearing in transparent frameless/client frame windows on Linux (#50541)

fix the appearance of transparent frameless and client frame windows
This commit is contained in:
Mitchell Cohen
2026-05-01 13:29:22 -04:00
committed by GitHub
parent 84ea8a15a2
commit dc58761a10
2 changed files with 9 additions and 6 deletions

View File

@@ -239,7 +239,9 @@ void ElectronDesktopWindowTreeHostLinux::UpdateFrameHints() {
if (ui::OzonePlatform::GetInstance()->IsWindowCompositingSupported()) {
// Set the opaque region.
std::vector<gfx::Rect> 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.

View File

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