Compton(现分支为Picom)是Linux下常用的合成窗口管理器,用于提升图形性能、减少屏幕撕裂并提供视觉效果。以下是常见问题及解决方案:
Failed to create backend
。bash
picom --backend glx --vsync # 尝试OpenGL后端
picom --backend xrender # 回退到XRender
若无效,检查驱动:
bash
glxinfo | grep "OpenGL vendor" # 确认驱动正常
sudo apt install mesa-utils # 安装缺失驱动(如NVIDIA需专有驱动)
bash
picom --vsync # 启用垂直同步
若仍存在,在配置文件(~/.config/picom.conf
)中添加:
ini
vsync = true;
backend = "glx";
glx-no-stencil = true;
ini
shadow = true;
shadow-radius = 12;
shadow-offset-x = -5;
shadow-offset-y = -5;
shadow-opacity = 0.5;
shadow-exclude = [ "class_g = 'Firefox'" ]; # 排除特定窗口
ini
blur = false;
fade-in-step = 0.03; # 减少动画步长
ini
unredir-if-possible = true; # 跳过全屏窗口
ini
mark-wmwin-focused = true;
ignore-shadow = [ "class_g = 'Discord'" ];
BadWindow
或Invalid parameter
。bash
mv ~/.config/picom.conf ~/.config/picom.conf.bak
picom --config /dev/null # 测试默认配置
bash
cp /etc/xdg/picom.conf ~/.config/picom.conf
ini
xinerama-shadow-crop = true; # 多显示器阴影处理
bash
picom --log-level DEBUG --log-file ~/picom.log
如果问题持续,可尝试其他合成管理器:
- Wayland:改用Sway或GNOME自带合成器。
- Xorg:尝试xcompmgr
或compton-tryone
(社区维护分支)。
通过以上步骤,大部分Compton/Picom问题均可解决。若问题复杂,建议提供日志和具体环境(如发行版、显卡型号)进一步排查。