Compton 是一个流行的 X11 合成窗口管理器,用于提供窗口透明度和阴影等视觉效果。以下是解决 Compton 配置中延迟问题的几种方法:
backend = "glx";
glx-no-stencil = true;
glx-no-rebind-pixmap = true;
vsync = "opengl-swc";
backend = "glx";
glx-no-stencil = true;
glx-swap-method = "exchange";
vsync = "opengl";
backend = "glx";
glx-no-stencil = true;
glx-use-copengl = true;
vsync = "opengl-swc";
# 减少阴影效果的开销
shadow = false;
# 或者精细调整阴影参数
shadow-radius = 7;
shadow-offset-x = -7;
shadow-offset-y = -7;
shadow-opacity = 0.7;
# 禁用不需要的窗口特效
no-dnd-shadow = true;
no-dock-shadow = true;
# 性能优化标记
paint-on-overlay = true;
glx-no-rebind-pixmap = true;
xrender-sync-fence = true;
# 设置刷新率匹配显示器
refresh-rate = 0; # 0 表示自动检测
# 或者手动指定
refresh-rate = 60; # 根据您的显示器设置
# 排除不需要合成的应用程序
shadow-exclude = [
"name = 'Notification'",
"class_g = 'Conky'",
"class_g ?= 'Notify-osd'",
"class_g = 'Cairo-clock'"
];
xrender
和 glx
之间切换测试glxgears
测试基础性能backend = "glx";
glx-no-stencil = true;
glx-no-rebind-pixmap = true;
vsync = "opengl-swc";
glx-swap-method = "exchange";
shadow = true;
shadow-radius = 7;
shadow-offset-x = -7;
shadow-offset-y = -7;
shadow-opacity = 0.7;
refresh-rate = 60;
shadow-exclude = [
"name = 'Notification'",
"class_g = 'Conky'",
"class_g ?= 'Notify-osd'",
"class_g = 'Cairo-clock'"
];
通过逐步调整这些参数,您应该能够显著减少 Compton 的延迟问题。建议每次只修改一个参数并测试效果,以便准确识别问题来源。