Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

gpui: Fix centered window bounds to display settings header (#62073)

Habis Ahmadcf4deb270f04
diff --git a/crates/gpui/src/geometry.rs b/crates/gpui/src/geometry.rs
index 8fe6d208269..1c87031c7aa 100644
--- a/crates/gpui/src/geometry.rs
+++ b/crates/gpui/src/geometry.rs
@@ -743,7 +743,10 @@ impl Bounds<Pixels> {
.or_else(|| cx.primary_display());
display
- .map(|display| Bounds::centered_at(display.bounds().center(), size))
+ .map(|display| {
+ let visible_bounds = display.visible_bounds();
+ Bounds::centered_at(visible_bounds.center(), size.min(&visible_bounds.size))
+ })
.unwrap_or_else(|| Bounds {
origin: point(px(0.), px(0.)),
size,