Fix a Wayland-related graphic bug for the status bar (#46466)

Release Notes:

- Address a scenario where scaling in Wayland can cause a 1px gap above
the status bar

Closes #46008

---------

Co-authored-by: Ben Kunkle <ben.kunkle@gmail.com>
This commit is contained in:
Paul Di Pietro 2026-04-23 05:08:08 -04:00 committed by GitHub
parent 4b01676a3b
commit 70d07f9088
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -92,6 +92,17 @@ impl Render for StatusBar {
)
// This border is to avoid a transparent gap in the rounded corners
.mb(px(-1.))
.mt({
#[cfg(target_os = "linux")]
let needs_gap_fix = {
// Running on Wayland and using some scaling levels other than 100% causes a
// 1px gap above the status bar; adding a margin avoids this.
gpui::guess_compositor() == "Wayland" && window.scale_factor() != 1.0
};
#[cfg(not(target_os = "linux"))]
let needs_gap_fix = false;
if needs_gap_fix { px(-1.) } else { px(0.) }
})
.border_b(px(1.0))
.border_color(cx.theme().colors().status_bar_background),
})