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

[Bug]: Tray Module Rendering Issues #2933

Open
patrick96 opened this issue Mar 25, 2023 · 10 comments
Open

[Bug]: Tray Module Rendering Issues #2933

patrick96 opened this issue Mar 25, 2023 · 10 comments

Comments

@patrick96
Copy link
Member

patrick96 commented Mar 25, 2023

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.

@zjeffer
Copy link
Contributor

zjeffer commented Mar 29, 2023

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

@patrick96
Copy link
Member Author

@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.

@zjeffer
Copy link
Contributor

zjeffer commented Mar 29, 2023

Thanks, this fixed it: zjeffer/dotfiles@ab1e7e9

@anhnamtran
Copy link
Contributor

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.

@patrick96
Copy link
Member Author

@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.

@an4s911

This comment was marked as off-topic.

@patrick96

This comment was marked as off-topic.

@an4s911

This comment was marked as off-topic.

@patrick96

This comment was marked as off-topic.

@iacore
Copy link

iacore commented Oct 9, 2023

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants