From 48a4cbad3776eab2f4237a5003494389c13c075f Mon Sep 17 00:00:00 2001 From: Greg Morenz Date: Wed, 7 Feb 2024 14:50:35 -0500 Subject: [PATCH] Don't move traffic lights while fullscreen Fixes #4712, or at least works around it. As discussed in the issue, setting the buttons frames while fullscreen can cause them to render in the wrong location. This fixes that by simply not moving them when fullscreen. --- crates/gpui/src/platform/mac/window.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/gpui/src/platform/mac/window.rs b/crates/gpui/src/platform/mac/window.rs index 9497c240c3..da42f919a5 100644 --- a/crates/gpui/src/platform/mac/window.rs +++ b/crates/gpui/src/platform/mac/window.rs @@ -348,6 +348,12 @@ struct MacWindowState { impl MacWindowState { fn move_traffic_light(&self) { if let Some(traffic_light_position) = self.traffic_light_position { + if self.is_fullscreen() { + // Moving traffic lights while fullscreen doesn't work, + // see https://github.com/zed-industries/zed/issues/4712 + return; + } + let titlebar_height = self.titlebar_height(); unsafe {