aboutsummaryrefslogtreecommitdiff
path: root/alacritty/src/event.rs
diff options
context:
space:
mode:
authorChristian Duerr <contact@christianduerr.com>2020-12-22 04:25:43 +0000
committerGitHub <noreply@github.com>2020-12-22 04:25:43 +0000
commitf19cbca9b4c98a33b786bd971e3abae66bd16e26 (patch)
tree7fe9ebce9cc2354029eb5458fe4517a194fd94da /alacritty/src/event.rs
parent8982000f01d5f476a995385253139b3555e2a5d0 (diff)
downloadr-alacritty-f19cbca9b4c98a33b786bd971e3abae66bd16e26.tar.gz
r-alacritty-f19cbca9b4c98a33b786bd971e3abae66bd16e26.tar.bz2
r-alacritty-f19cbca9b4c98a33b786bd971e3abae66bd16e26.zip
Disable shadows for transparent windows on macOS
Commit 5725f58 introduced a performance regression on macOS due to excessive calls to the `invalidateShadow` function, however calling this function only on redraw after a resize was performed does not fix the underlying problem. As a solution, window shadows are now disabled completely for all transparent windows. This makes sure there is no performance impact, while still solving the problem with text artifacts on resize. Fixes #4604.
Diffstat (limited to 'alacritty/src/event.rs')
-rw-r--r--alacritty/src/event.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/alacritty/src/event.rs b/alacritty/src/event.rs
index 87b1d5c8..bbb0da0f 100644
--- a/alacritty/src/event.rs
+++ b/alacritty/src/event.rs
@@ -1279,6 +1279,10 @@ impl<N: Notify + OnResize> Processor<N> {
#[cfg(target_os = "macos")]
crossfont::set_font_smoothing(config.ui_config.font.use_thin_strokes);
+ // Disable shadows for transparent windows on macOS.
+ #[cfg(target_os = "macos")]
+ processor.ctx.window.set_has_shadow(config.ui_config.background_opacity() >= 1.0);
+
*processor.ctx.config = config;
// Update cursor blinking.