debian

Debian Compton如何解决冲突问题

小樊
37
2025-12-03 01:23:59
栏目: 智能运维

Debian 上 Compton 冲突的定位与解决

一、先判定冲突来源

二、常见冲突场景与对应处理

三、可直接套用的配置示例

backend = "xrender"
vsync = "true"
shadow = false
blur = false
fade-in = false
fade-out = false
focus-exclude = [ "class_g = 'gnome-shell'" ]
mark-wmwin-focused = true
mark-ovredir-focused = true
detect-rounded-corners = true
detect-client-leader = true
backend = "glx"
vsync = "true"   # 若出现撕裂再尝试 "drm" 或 "opengl-swc"
glx-no-stencil = true
glx-copy-from-front = false
glx-use-gpushader4 = true
shadow = true
shadow-radius = 12
shadow-offset-x = -15
shadow-offset-y = -15
fade-in = 200
fade-out = 200
# 排除 GNOME Shell 避免与自带合成叠加
focus-exclude = [ "class_g = 'gnome-shell'" ]

# 为全屏游戏禁用阴影与模糊,减少开销
opacity-rule = [ "90:class_g = 'game.exe'", "100:class_g = 'Steam'" ]
shadow-exclude = [ "class_g = 'game.exe'" ]
blur-exclude = [ "class_g = 'game.exe'" ]

将以上片段写入 ~/.config/compton.conf,保存后用 compton --config ~/.config/compton.conf --check 校验,再重启会话或重新登录以生效。

四、启动与自启动的正确做法

[Unit]
Description=Compton Window Composer
After=graphical-session.target

[Service]
ExecStart=/usr/bin/compton --config %h/.config/compton.conf
Restart=on-failure

[Install]
WantedBy=default.target

启用命令:systemctl --user daemon-reload && systemctl --user enable --now compton.service。注意大多数桌面会话并不使用系统级 systemd 管理 Compton,优先采用会话级或用户级方式。

五、快速排查清单

0
看了该问题的人还看了