aboutsummaryrefslogtreecommitdiff
path: root/alacritty/src
diff options
context:
space:
mode:
authorKirill Chibisov <contact@kchibisov.com>2022-05-20 22:23:55 +0300
committerGitHub <noreply@github.com>2022-05-20 22:23:55 +0300
commit9f8c5c4f5659308ee1bb3a22e7d0ca2d04db8874 (patch)
tree3190d3fe789698f7f6b1f96a87e3ac077b50edf9 /alacritty/src
parente319ca93a6574fbdeee3f764c4390917f558e3a7 (diff)
downloadr-alacritty-9f8c5c4f5659308ee1bb3a22e7d0ca2d04db8874.tar.gz
r-alacritty-9f8c5c4f5659308ee1bb3a22e7d0ca2d04db8874.tar.bz2
r-alacritty-9f8c5c4f5659308ee1bb3a22e7d0ca2d04db8874.zip
Enable damage tracking only on Wayland
Other platforms don't have such concepts in general or have them via different interfaces not related to EGL. This commit also resolves some minor clippy issues. Fixes #6051. Co-authored-by: Christian Duerr <contact@christianduerr.com>
Diffstat (limited to 'alacritty/src')
-rw-r--r--alacritty/src/display/window.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/alacritty/src/display/window.rs b/alacritty/src/display/window.rs
index f098d7f8..2e8ed085 100644
--- a/alacritty/src/display/window.rs
+++ b/alacritty/src/display/window.rs
@@ -471,7 +471,23 @@ impl Window {
self.windowed_context.swap_buffers_with_damage(damage).expect("swap buffes with damage");
}
+ #[cfg(any(target_os = "macos", windows))]
pub fn swap_buffers_with_damage_supported(&self) -> bool {
+ // Disable damage tracking on macOS/Windows since there's no observation of it working.
+ false
+ }
+
+ #[cfg(not(any(target_os = "macos", windows)))]
+ pub fn swap_buffers_with_damage_supported(&self) -> bool {
+ // On X11 damage tracking is behaving in unexpected ways on some NVIDIA systems. Since
+ // there's no compositor supporting it, damage tracking is disabled on X11.
+ //
+ // For more see https://github.com/alacritty/alacritty/issues/6051.
+ #[cfg(all(feature = "x11", not(any(target_os = "macos", windows))))]
+ if self.window().xlib_window().is_some() {
+ return false;
+ }
+
self.windowed_context.swap_buffers_with_damage_supported()
}