aboutsummaryrefslogtreecommitdiff
path: root/alacritty/src/display.rs
diff options
context:
space:
mode:
authorChristian Duerr <contact@christianduerr.com>2020-12-21 06:40:22 +0000
committerGitHub <noreply@github.com>2020-12-21 06:40:22 +0000
commit5725f5812ca5e8d7d992da4ac66aa454a8a9a9ad (patch)
tree9f15030007cb7a7f66c95640623f74e735754152 /alacritty/src/display.rs
parent6e1b9d8b2502f5b47dc28eb5e0853e46ad8b4e84 (diff)
downloadr-alacritty-5725f5812ca5e8d7d992da4ac66aa454a8a9a9ad.tar.gz
r-alacritty-5725f5812ca5e8d7d992da4ac66aa454a8a9a9ad.tar.bz2
r-alacritty-5725f5812ca5e8d7d992da4ac66aa454a8a9a9ad.zip
Fix artifacts on macOS with transparent windows
Due to the way macOS draws shadows for transparent windows, resizing them will lead to text artifacts remaining present after a window has been resized. The `invalidateShadow` call is used whenever the opacity isn't `1.0` to make sure these shadows are cleared before redrawing, so no artifacts remain when resizing transparent windows. Fixes #889.
Diffstat (limited to 'alacritty/src/display.rs')
-rw-r--r--alacritty/src/display.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/alacritty/src/display.rs b/alacritty/src/display.rs
index 1fe1d2de..fb82b9f8 100644
--- a/alacritty/src/display.rs
+++ b/alacritty/src/display.rs
@@ -610,6 +610,12 @@ impl Display {
#[cfg(all(feature = "wayland", not(any(target_os = "macos", windows))))]
self.request_frame(&self.window);
+ // Clear window shadows to prevent shadow artifacts on macOS.
+ #[cfg(target_os = "macos")]
+ if config.ui_config.background_opacity() < 1.0 {
+ self.window.invalidate_shadow();
+ }
+
self.window.swap_buffers();
#[cfg(all(feature = "x11", not(any(target_os = "macos", windows))))]