polybar / polybar

A fast and easy-to-use status bar

Home Page:https://polybar.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]: Tray Module Rendering Issues

patrick96 opened this issue · comments

This is a collection issue for any tray icon rendering problems in the new tray module.
With #2609 being merged, the tray module gets an overhauled rendering that should fix many problems.
However, there are some issues that remain.

For me, I mainly notice this with the dropbox tray icon:

dropbox

The icon should take on the same background as the bar (red), but instead just has a completely different color.
In practice the icon just uses arbitrary data for its background, often images rendered before (e.g. bar contents).

I have not been able to figure out why this is happening, there don't seem to be any obvious issues on our side.
I am starting to suspect that the dropbox application itself (which is responsible for rendering the icon) actually draws the background this way for some reason.

If you are using the tray module and experience similar rendering issues, please report them here.
Please also include a screenshot, the name of the application, and your polybar version (polybar -v).

Offending applications:

  • dropbox

Related Issues

Developer info (Click to expand)

I have also tested out how other applications deal with the dropbox icon:

  • i3bar: No transparency, otherwise seems to work, but can't handle changes of bar background without restarting i3bar
  • stalonetray, trayer: Seems to work, but can't handle wallpaper change if using transparency
  • tint2: Wrong background regardless of transparency

No other implementation can deal with changing the icon background dynamically.
In addition, most trays struggle to get a correct background.

Stalonetray seems to have some special handling for WM_NORMAL_HINTS and before clearing the tray icon, it sets the visibility to VisibilityFullyObscured and then VisibilityUnobscured.

I'm not sure if it's the same issue, but since about 2 days ago my systray started using the bar's background color instead of the tray-background color. I can confirm that changing the bar background color will also change the tray background color.

Here's how it looks (the systray module should have #FFFFFF as the background color):

image

Here are my dotfiles: https://github.com/zjeffer/dotfiles/tree/main/.config/polybar/

Output of polybar -v:

polybar 3.6.3-158-g921e2d06

Features: +alsa +curl +i3 +mpd +network(libnl) +pulseaudio +xkeyboard

@zjeffer The tray module loads its settings from the module section (I guess I changed that, I thought it was always like this). The tray-* settings in the bar section are only for the legacy tray.

In any case, the tray module settings are subject to change before the next release.

Thanks, this fixed it: zjeffer/dotfiles@ab1e7e9

I spent some more time with my implementation of show/hide tray in #2954 and found a "fun" little rendering bug.

If the tray is "hidden" and a new tray icon shows up. Overlapping occurs and one would have to unhide/hide the tray to fix it.

GIF below where I open qBittorrent and the tray icon shows up overlapping
polybar_show_hide_tray_overlapping

I think reproducing would simply be to set the new tray module to hidden and starting a program that adds a new tray icon.

@anhnamtran Thanks for telling us, I can also easily reproduce this. I guess our docking logic doesn't take into account whether the tray is actually hidden. I'll convert this into a separate issue and target it for the next release.

I've been noticing some weird issues on the tray as well. Its been around 2 months since I first noticed iirc. The bluetooth icon, when turned off is supposed to be gray, and it is. But when I turn it on and then off again then it stays white except for a quarter of the icon.
image

The network icon when connecting after it was disconnected basically gets an overlap of two or three different icons, like I can see the disconnected icon behind the connected icon, and vice versa.
image

Similar thing with the icons of the other applications as well. For example I use caffeine-ng to inhibit sleep, and it uses the enabled icon all the time whether it be enabled or disabled. Again I think its an issue of being overlapped by the previously used icon.

@an4s911 Is that with the new tray module?

@an4s911 Is that with the new tray module?

Im not sure if it is the new tray or the old. I haven’t changed anything in my config file in a while.

I use Arch Linux and I've updated everything. polybar -v gives me:

polybar 3.6.3

Features: +alsa +curl +i3 +mpd +network(libnl) +pulseaudio +xkeyboard

Then you're still on the old tray, the new tray isn't part of a stable release yet.

image

the bar is high enough, but with the border it's not high enough. the rightmost icon is clipping

is there a way to remove the up/down margin?