mirror of
https://github.com/electron/electron.git
synced 2026-05-02 03:00:22 -04:00
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:
@@ -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.
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user