diff --git a/crates/gpui/src/platform.rs b/crates/gpui/src/platform.rs index 6847a34a843395a18531bcf3114d1dfe24f7bf29..047a005548ba0c7c34f6641a91333723883203cc 100644 --- a/crates/gpui/src/platform.rs +++ b/crates/gpui/src/platform.rs @@ -289,10 +289,13 @@ pub trait PlatformDisplay: Send + Sync + Debug { /// Get the default bounds for this display to place a window fn default_bounds(&self) -> Bounds { - let center = self.bounds().center(); - let offset = DEFAULT_WINDOW_SIZE / 2.0; + let bounds = self.bounds(); + let center = bounds.center(); + let clipped_window_size = DEFAULT_WINDOW_SIZE.min(&bounds.size); + + let offset = clipped_window_size / 2.0; let origin = point(center.x - offset.width, center.y - offset.height); - Bounds::new(origin, DEFAULT_WINDOW_SIZE) + Bounds::new(origin, clipped_window_size) } }