polybar icon indicating copy to clipboard operation
polybar copied to clipboard

No tray icons

Open yaute74 opened this issue 7 years ago • 23 comments

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

yaute74 avatar Jul 30 '18 20:07 yaute74

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

NBonaparte avatar Jul 31 '18 20:07 NBonaparte

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.

patrick96 avatar Jul 31 '18 21:07 patrick96

I use i3

yaute74 avatar Aug 01 '18 19:08 yaute74

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

Doshirae avatar Aug 08 '18 01:08 Doshirae

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

NBonaparte avatar Aug 08 '18 05:08 NBonaparte

I don't remember sorry, I didn't thought of writing it down

But yesterday, the icons suddenly reappeared, and I don't know why...

Sent from my Android device with K-9 Mail. Please excuse my brevity.

Doshirae avatar Aug 08 '18 11:08 Doshirae

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.

avernan avatar Sep 07 '18 13:09 avernan

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

Quesj avatar Oct 05 '18 21:10 Quesj

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

oakbrad avatar Oct 06 '18 19:10 oakbrad

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)

ghost avatar Oct 14 '18 15:10 ghost

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?

ghistes avatar Oct 15 '18 18:10 ghistes

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.

patrick96 avatar Oct 15 '18 19:10 patrick96

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 :)

itapai avatar Dec 24 '18 11:12 itapai

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 !

ghost avatar Dec 26 '18 09:12 ghost

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)

sheijk avatar Jan 15 '19 02:01 sheijk

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

patrick96 avatar Jan 15 '19 16:01 patrick96

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

sheijk avatar Jan 17 '19 03:01 sheijk

@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

patrick96 avatar Jan 17 '19 08:01 patrick96

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)

baszoetekouw avatar Jan 18 '19 16:01 baszoetekouw

@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 avatar Jan 18 '19 17:01 patrick96

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

patrick96 avatar Jan 19 '19 20:01 patrick96

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. :)

felipendc avatar Mar 28 '20 14:03 felipendc

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.

asolopovas avatar Apr 21 '21 09:04 asolopovas

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.

mattiasflodin avatar Nov 29 '22 08:11 mattiasflodin

Just upgraded to ubuntu 22.04 with i3 and this is happening

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.

codethief avatar Feb 22 '23 22:02 codethief

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

patrick96 avatar Mar 25 '23 21:03 patrick96

@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?)

codethief avatar Apr 04 '23 10:04 codethief

@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

patrick96 avatar Apr 04 '23 12:04 patrick96