diff --git a/window/src/os/macos/window.rs b/window/src/os/macos/window.rs index 3a8edf711..4438ac011 100644 --- a/window/src/os/macos/window.rs +++ b/window/src/os/macos/window.rs @@ -702,19 +702,18 @@ impl WindowInner { } fn update_window_shadow(&mut self) { - if config().window_background_opacity() < 1.0 { - unsafe { - self.window.setOpaque_(NO); - // Turn off the window shadow, because when the background is transparent - // having the shadow enabled seems to correlate with ghostly remnants - // see: https://github.com/wez/wezterm/issues/310 - self.window.setHasShadow_(NO); - } + let is_opaque = if config().window_background_opacity() >= 1.0 { + YES } else { - unsafe { - self.window.setOpaque_(YES); - self.window.setHasShadow_(YES); - } + NO + }; + unsafe { + self.window.setOpaque_(is_opaque); + // when transparent, also turn off the window shadow, + // because having the shadow enabled seems to correlate + // with ghostly remnants see: + // https://github.com/wez/wezterm/issues/310 + self.window.setHasShadow_(is_opaque); } } }