6

I am using compton as my composite manager with i3. When compton is enabled and there is an image (png) on the root X window, you can see flickering while switching workspaces.

enter image description here

There is no issue when compton is disabled or root window is solid color. None of this is acceptable for me. Since the solid color does not cause an issue I was thinking that using low-level tool should fix the problem. I have replaced feh with hsetroot but nothing has changed. I have also tested xloadimage but when compton is enabled it does not work (X root reflects current workspace for unknown reason). Gui app nitrogen produces the same effect.

Official repository seems to be too overloaded and issues wait for months to be answered. Compton with i3 (or any other lightweight wm) is quite popular tear-free decision and I do not think that people do not set wallpapers or ignore such annoying things. I start compton (v0.1_beta2.5) with the following command.

compton --daemon \
--config /dev/null \
--vsync opengl-swc \
--xrender-sync \
--xrender-sync-fence \
--fading \
--fade-in-step 0.2 \
--fade-out-step 0.2 \
--unredir-if-possible \
--paint-on-overlay \
--backend glx

Disabling fading do not solve the problem.

Evgeniy
  • 183
  • 1
  • 8

2 Answers2

2

I've used Picom insted of Compton since it made this transition, but anyway, this should apply in a sort to Compton as well.

Adding this lines to configuration ~/.config/picom/picom.conf should do the trick:

# Fix background flickering during workspace switching
fading = true; # Fade windows during opacity changes
fade-delta = 50; # The time between steps in a fade in milliseconds
fade-in-step = 1; # Opacity change between steps while fading in
fade-out-step = 1; # Opacity change between steps while fading out

Reference issue

Barnercart
  • 136
  • 5
  • This means turns fading off, and it solves the issue. Please modify your answer to avoid unnecessary configuration. – Evgeniy Jun 22 '22 at 13:12
  • You're right but setting fading to off doesn't work unfortunately (I've omitted this in the answer). I was referring to this discussion and this comment (https://github.com/yshui/picom/issues/16#issuecomment-792739119) in particular which explains in details the issue. – Barnercart Jun 22 '22 at 19:58
  • Okay, I get it. Though it is strange that I do not see flickering when fading is off. I am marking as an answer for those who is facing the issue with default configuration. – Evgeniy Jun 22 '22 at 20:19
-1

It was a long time ago, and I did not want to dig into it as the issue does not bother me anymore, but since @Barnercart did some research, I decided to test it with i3. Though there is no flickering with these settings, I do not want to accept the answer because it contains unnecessary configuration. It does not make any sense to enable fading and set fade-*-step to 1 which basically means there is no fading at all. So, the correct answer to the issue would be to disable fading (which is by default). If @Barnercart do not mind to alter his answer, then I would accept it.

For those who likes fading I would recommend to use different window manager, like dwm. The solution is in its logic regarding window management. IIRC, i3 makes call to X11 to hide unseen windows forcing compositor to apply fading, while dwm moves them off-screen. That is why, when switching workspace, we see nothing behind window because its opacity has not been changed.

Evgeniy
  • 183
  • 1
  • 8