Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polybar tray in i3wm flickering #7

Closed
Nawot opened this issue Feb 19, 2022 · 9 comments
Closed

Polybar tray in i3wm flickering #7

Nawot opened this issue Feb 19, 2022 · 9 comments
Assignees
Labels
bug Something isn't working

Comments

@Nawot
Copy link

Nawot commented Feb 19, 2022

Maybe you needed

OS: Manjaro 21.2.1 Qonos
Xgifwallpaper V: 0.3.1
Polybar V: 3.5.7
Picom V: vgit-c4107

What's happened

Hi all!
When xgifwallpaper working the tray of polybar beginning flickering.
If I kill xgifwallpaper that flicker will stop.
Once icons flickers with more intensity, other with less.

This look like this:
flicker

@calculon102 calculon102 self-assigned this Feb 20, 2022
@calculon102
Copy link
Owner

Thank you for your report!

I can confirm this. Reproducible, even without running a compositor, like Picom.

At this first moment, I would suspect the issue in the tray-handling of Polybar. It listens on property-changes for pseudo-transparency, which are updated by xgifwallpaper every frame.

See https://github.com/polybar/polybar/blob/ab915fb724546e7abfcb35cbaf863ce2bca613ec/src/x11/tray_manager.cpp#L1019.

Still strange, that the tray-elements flicker at different intervals.

I leave this issue unclassified, until I have a better understanding of the cause.

@Nawot
Copy link
Author

Nawot commented Feb 22, 2022

Oh, sorry, I overlooked that some icons sometimes disappear (just not visible, it's clickable) for a long time ~(40s-2m).
Maybe this info help to solve this problem

@Nawot
Copy link
Author

Nawot commented Feb 22, 2022

I dug into the Polybar code and commented out random code pies. And I discovered that something happening in the refresh_window function. Something wrong when tray clearing.
If I comment out this line that flickering will stop

@calculon102
Copy link
Owner

calculon102 commented Feb 24, 2022

Thank you, @Nawot!

Honestly, I don't know what to do about this within xgifwallpaper - at this moment. As far as I understand, every software component behaves correctly:

  • xgifwallpaper updates atoms with reference of the background pixmap of the root window for composited windows
  • polybar listens to atom changes, redraws itself
  • polybar informs the tray-clients to redraw their complete content within the system-tray

This is all as designed... :) But surely leads to lots and lots of events and redraws of several clients within a second. Which (in my current opinion) leads to the effect. The flicker rate of the icons depending on the implementation of the eventual tray-client.

The only thing I could now think of, is to optimize polybar in a way, that a it only redraws the tray window and its client, only when it has a transparent background. That could soften the issue and fix it for you, when using a fully opaque bar-background.

I made a pull-request here: polybar/polybar#2604

You may try the fix youself: https://github.com/calculon102/polybar

I leave this issue open for now, maybe the polybar response gives alternative solutions or ideas.

@Nawot
Copy link
Author

Nawot commented Mar 13, 2022

Hey! I wanted close this issues, but first I wanted test polybar with you solution. Since I didn't close, means something be wrong.
So, now I builded and installed new version the polybar from the source and flickering there is anyway. I don't know why. I thought that maybe this because my a old laptop is right the veeery old and can't normal rendering. But do you remember that I commented some line and flicker stopped? I don't know why you solution not working for me

@calculon102
Copy link
Owner

calculon102 commented Mar 15, 2022

Hey @Nawot, the line you uncommented was a great hint. As a solution it was to broad, would have introduced regressions into polybar.

With the current solution, now pulled into polybar, the flicker should stop, if your bar has no transparency. If there is any, there is still flicker "as designed" - as there is still no solution to that. Honestly I don"t know, if I am able to solve this, at the moment.

For a test, try some solid color like #000000 as background for your bar.

@Nawot
Copy link
Author

Nawot commented Mar 16, 2022

Alright. I just again will comment the there line and build the polybar while we would find solution. Anyway I not see other errors without this line

@Nawot
Copy link
Author

Nawot commented Mar 16, 2022

Oh yes, if bg color set's to #00000 flicker stopping

@calculon102
Copy link
Owner

calculon102 commented Mar 19, 2022

@Nawot that are great news! As long as you set background-color without transparency, it will not flicker. For example, only using six-digit RGB-hex-values, like #000000.

There is not much more to do here, I guess. For the line you commented in polybar: to reproduce the regression, try changing the wallpaper multiple times while using a compositor and polybar with transparent background. The background of the tray-icons won't be updated, then.

@calculon102 calculon102 added the bug Something isn't working label Oct 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants