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

No tray icons #1355

Closed
yaute74 opened this issue Jul 30, 2018 · 29 comments · Fixed by #2609
Closed

No tray icons #1355

yaute74 opened this issue Jul 30, 2018 · 29 comments · Fixed by #2609
Milestone

Comments

@yaute74
Copy link

yaute74 commented Jul 30, 2018

Hello,

I cannot see tray icons, I have this error: error: tray: Failed to put tray above 0x0e00002 in the stack (XCB_MATCH (8))

The polybar config file: https://pastebin.com/4Fc0vy2k
The polybar logs: https://pastebin.com/V62tnB0x

My version of polybar is the 3.2.0.

Thanks for your help

@NBonaparte
Copy link
Member

What WM are you using? The icons aren't appearing because as the error states, the tray window is stuck behind the bar.

@patrick96 patrick96 added the tray label Jul 31, 2018
@patrick96
Copy link
Member

Seems to be the opposite problem as #425. For some reason, on some WMs under certain circumstances, we can't reposition the tray, I wasn't able to figure out why that is though.

@yaute74
Copy link
Author

yaute74 commented Aug 1, 2018

I use i3

@Doshirae
Copy link

Doshirae commented Aug 8, 2018

I have the exact same problem since months (made me think about leaving polybar :/)
And I also am using i3

@NBonaparte
Copy link
Member

@Doshirae Do you remember approximately when this started to happen? Perhaps i3 changed some of their window handling and caused this issue.

@Doshirae
Copy link

Doshirae commented Aug 8, 2018 via email

@avernan
Copy link

avernan commented Sep 7, 2018

I've installed polybar today for the first time and I am having this same issue.
I'm running i3 4.15-1 and polybar 3.2.1-1.

Let me know if there are more info I can gather/provide.

Edit. The tray and icons appear in the bar and other elements appear to shift properly. Nevertheless the error is still shown in the log.

@Quesj
Copy link

Quesj commented Oct 5, 2018

I think something is clashing between i3 and polybar. I'm on the same versions as @avernan, and I'm also getting the same error.

I also get the dropping unmatched character warning when I put the animations in my config. I'm using FontAwesome and I've replaced the already existing icons in the module file with the ones from the Font Awesome cheat sheet (Even though I thought they were the same).

And lastly I can't get the battery percentage and timer working...

@oakbrad
Copy link

oakbrad commented Oct 6, 2018

I am also seeing this same behavior and error, on Solus Linux with i3-gaps. Sometimes it works, sometimes not all my icons show up, and sometimes when they do I am not able to click on them (it being behind the bar makes sense). Relaunching polybar a few times usually fixes it.

polybar v3.2.1
i3 v4.15.0.1

I am new to both so figured I had a configuration issue...

@ghost
Copy link

ghost commented Oct 14, 2018

same thing as @oakbrad, only that icons always appear but sometimes i can't click on them.

polybar 3.2.1
i3-gaps 4.15.0.1-323-gccb19472 (2018-09-28, branch "gaps-next")
Debian GNU/Linux unstable (sid)

@ghistes
Copy link

ghistes commented Oct 15, 2018

polybar 3.2.0-50-gabdd5f9
i3 4.15-1 on debian testing

polybar reports "error: tray: Failed to put tray above 0x1600002 in the stack (XCB_MATCH (8))", no tray is visible.

i3blocks displays the tray fine. Is there any chance if this getting fixed soon?

@patrick96
Copy link
Member

Is there any chance if this getting fixed soon?

There is a new tray implementation in the works but no ETA yet. The easiest solution for you would be to disable the tray in polybar and use a dedicated program like stalonetray or tint2 and have a text module in polybar that reserves space or set a padding so that the tray doesn't overlap anything.

@itapai
Copy link

itapai commented Dec 24, 2018

Hi,

These 2 lines seems to be fixing this particular error:

tray-position = right
; other tray settings

wm-restack = i3
override-redirect = true

Hope this comes in handy :)

@ghost
Copy link

ghost commented Dec 26, 2018

The true problem is probably the restack, using
wm-restack = i3
is enough. and
override-redirect = true
will make windows apear under the bar, and accept offset settings such as
offset-x = 30%But it still fixed it for me, but i had to create an invisible bar over the main bar for windows to align porperly
Thanks !

@sheijk
Copy link

sheijk commented Jan 15, 2019

Having the same issue but it does not get fixed by setting wm-restack and override-redirect. If I add those two options it will start without error but the tray icons will be rendered around 50 pixel above the polybar.

Versions are i3 4.15, polybar 3.3.0 (from Ubuntu 18.10 repository)

@patrick96
Copy link
Member

@sheijk Can you use tray-offset-x and tray-offset-y to reposition the tray?

@sheijk
Copy link

sheijk commented Jan 17, 2019

Yes, I can re-position it that way. Thanks!

Also a correction: with wm-restack = i3 and override-redirect = true the tray will be rendered inside the bar (although the bar is just above where the i3 bar usually sits and windows get rendered over it but I think that is the way it should be?). But without those two options the tray gets rendered at the wrong place. It looks like it's just the same position the tray icons/bar would be placed if the two options are on

@patrick96
Copy link
Member

@sheijk When using override-redirect = false in i3, i3 will position the bar itself and the offset-x and offset-y options don't have any effect so it's better not to use them and the tray should then be positioned correctly.

The reason the tray appears at this weird position is because it's a separate window that always uses override-redirect and thus i3 doesn't reposition the tray and the tray is rendered at the position where it would be when i3 didn't move the bar around

@baszoetekouw
Copy link

I'm also seeing this error (with current master polybar and version 4.16 of i3). Any combination of wm-restack=i3 and override-redirect=true as suggested above don't solve the issue for me, however, but it seems that is cause by something different (more below).

The exact error message I get is:

error: tray: Failed to put tray above 0x2e00002 in the stack (XCB_MATCH (8))

Note that error code 8 here seems to be a XCB_MATCH error.
According to the man page occurs when

You specified a Sibling without also specifying StackMode or the window is not actually a Sibling. 

This seem to be a hint toward the cause of this bug. Looking at the window list as produced by xwininfo -tree -root, the tray window and the main polybar aren't actually siblings (but rather uncle/nephew) when override_redirect = false:

  Root window id: 0x1a0 (the root window) "i3"
  Parent window id: 0x0 (none)
     222 children:
     0x4400009 "Polybar tray window": ("tray" "Polybar")  1x32+2554+1408  +2554+1408
     0xc003b1 "[i3 con] container around 0x559de7a32690": ("i3-frame" "i3-frame")  2560x32+0+1408  +0+1408
        1 child:
        0x4400002 "polybar-main_eDP-1": ("polybar" "Polybar")  2560x32+0+0  +0+1408

When override_redirect = true otoh, they are actual siblings and the error does not occur:

  Root window id: 0x1a0 (the root window) "i3"
  Parent window id: 0x0 (none)
     222 children:
     0x4400009 "Polybar tray window": ("tray" "Polybar")  1x32+2554+1408  +2554+1408
     0x4400002 "polybar-main_eDP-1": ("polybar" "Polybar")  2560x32+0+1408  +0+1408

Also note here that the tray window exists, but is only 1 pixel wide. That is probably a different issue though (possibly #1609 or #1603)

@patrick96
Copy link
Member

@baszoetekouw Thanks for digging into that. Interesting, so with override_redirect = false i3 not only repositions the window, it also sets another parent for it thus making the tray and polybar no longer siblings. I managed to reparent the tray, will see what kind of problems this all will solve and will open a PR.

In general the tray has a width of 1px if there are no tray icons, otherwise it's larger, so you probably have buggy tray icons.

patrick96 added a commit to patrick96/polybar that referenced this issue Jan 19, 2019
WMs like i3 and openbox reparent the bar window when override-redirect
is false, because of that the restacking of the tray window often didn't
work.

This should basically eliminate "Failed to put tray above..." errors.

Fixes polybar#425
Fixes polybar#1355
@patrick96 patrick96 added the bug label Jan 19, 2019
@patrick96
Copy link
Member

Was able to fix it (see #1615). The fix should appear in either the 3.3.1 or 3.4.0 release.

stav121 pushed a commit to stav121/i3wm-themer that referenced this issue Oct 31, 2019
Added fixes as mentioned in github.com/polybar/polybar/issues/1355#issuecomment-449723313
@felipendc
Copy link

Hi,

These 2 lines seems to be fixing this particular error:

tray-position = right
; other tray settings

wm-restack = i3
override-redirect = true

Hope this comes in handy :)

Bruh, you rock!!!!!!!!!!!!!!!!!!!!!!!!!
That's working like a dream!!!!!!!
Thank you so much for sharing this knowledge. :)

@asolopovas
Copy link

The same thing happens sporadically when you combine xmonad with polybar, sometimes tray icons appear sometimes they don't, every boot either works or doesn't.

stav121 pushed a commit to stav121/i3wm-themer that referenced this issue Oct 28, 2021
Added fixes as mentioned in github.com/polybar/polybar/issues/1355#issuecomment-449723313
stav121 pushed a commit to stav121/i3wm-themer that referenced this issue Oct 28, 2021
Added fixes as mentioned in github.com/polybar/polybar/issues/1355#issuecomment-449723313
stav121 pushed a commit to stav121/i3wm-themer that referenced this issue Oct 28, 2021
Added fixes as mentioned in github.com/polybar/polybar/issues/1355#issuecomment-449723313
stav121 pushed a commit to stav121/i3wm-themer that referenced this issue Oct 28, 2021
Added fixes as mentioned in github.com/polybar/polybar/issues/1355#issuecomment-449723313
stav121 pushed a commit to stav121/i3wm-themer that referenced this issue Oct 28, 2021
Added fixes as mentioned in github.com/polybar/polybar/issues/1355#issuecomment-449723313
stav121 pushed a commit to stav121/i3wm-themer that referenced this issue Oct 28, 2021
Added fixes as mentioned in github.com/polybar/polybar/issues/1355#issuecomment-449723313
stav121 pushed a commit to stav121/i3wm-themer that referenced this issue Oct 28, 2021
Added fixes as mentioned in github.com/polybar/polybar/issues/1355#issuecomment-449723313
stav121 pushed a commit to stav121/i3wm-themer that referenced this issue Oct 28, 2021
Added fixes as mentioned in github.com/polybar/polybar/issues/1355#issuecomment-449723313
stav121 pushed a commit to stav121/i3wm-themer that referenced this issue Oct 28, 2021
@patrick96 patrick96 added this to the 3.7.0 milestone Feb 21, 2022
@mattiasflodin
Copy link

These 2 lines seems to be fixing this particular error:

tray-position = right
; other tray settings

wm-restack = i3 
override-redirect = true

This did not change anything for me (except for override-redirect causing the bar to end up hidden below other windows as soon as I start any software, which would make it useless anyway). I'm on polybar 3.5.7 and i3 4.20.1.

@page-fault-in-nonpaged-area

Just upgraded to ubuntu 22.04 with i3 and this is happening

@codethief
Copy link

codethief commented Feb 22, 2023

I'm experiencing the same issue on Ubuntu 22.04.2 LTS with i3 v4.19.1-7-ge61a2311 and polybar v3.5.7 and override-redirect = false.

If I set override-redirect = true the tray icons work as expected (irrespective of wm-restack) but as @mattiasflodin mentioned, this doesn't help because now the bar either covers the windows or the windows cover the bar.

@patrick96
Copy link
Member

This is fixed by #2609 if you are using the new tray module.

@codethief
Copy link

@patrick96 Fantastic work, thank you! Is there anything that needs to be done on the user side (i.e. in the config) to enable this, beyond updating Polybar? (Speaking of which, will there be a new Polybar release in the near future?)

@patrick96
Copy link
Member

@codethief You will need to switch over to using the tray module instead of using the tray settings in the bar section. There is a small example in #2689.

There are still a few things I want to get into the next release (see https://github.com/polybar/polybar/milestone/13) before it is ready

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

Successfully merging a pull request may close this issue.