-
-
Notifications
You must be signed in to change notification settings - Fork 693
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
[WIP] Fix tray restacking issues #1615
Conversation
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
Introduces `tray-reparent = true` in the bar section Reparenting may impede our ability to use the tray offset values to their fullest extent. For example in dropbox, the bar parent window is a window with the exact same dimensions, so if the tray becomes a child of that window, we cannot get the tray to draw outside of those bounds as we could before.
Dang, just found some issues when bar offset is used |
Is this works well without bar offset? |
It should. I have not seen any issues in my testing. |
How is this still pending? It's related to #425 which is a long going issue. Still active issue. |
@im-n1 It requires me to rewrite all the code that handles tray positioning (which is most of the tray code) and I don't really have time for that right now. Feel free to add changes to this PR if you have the time to rewrite the tray coordinate handling. |
Okay, seems reasonable. I would like to help but C++ is not my thing. |
Since you mentioned in this thread that it solves the issue but I'm still getting the error of And the system tray icons are missing in it. I tried a combination of |
i had a problem when tray was on top of my fullscreen applications. thank you for this changes. now it works fine for me. (i use openbox.) |
On i3-gaps, the tray stays over floating windows while the rest of the bar is set to stay behind, even with |
I've had this problem for so long and it's annoyed me so much I've made a github account just to comment here. I added the tray-reparent section to the polybar config to no avail, i've done fiddling to try and fix it to no avail. It doesn't occur in fullscreen but it occurs when a floating window goes over it or the i3-msgbar appears on top. This has been a bug for 4 years and it's a really annoying one, can this please be fixed? |
@JimPix1 Did you compile this PR and it still doesn't work? |
I didn't compile anything, what do you mean by PR? |
You mentioned |
Oh, I just added that section to my config..that's not the correct way to get it working? |
This pull request contains the work-in-progress changes to fix the bug, it is not yet part of the code or part of a release, that's why it's not fixed yet. You can try out the fix, by compiling this pull-request, but you will have an outdated polybar. Also, you shouldn't need |
So how would I fix it? This has happened to me since I first got polybar, from mint to arco, is tray-reparent doesnt fix it what will? |
The changes in this pull-request are the fix. They're not finished yet, but they should work in most cases (unless you use |
So how do I add these changes? |
Guess I'll use polybar once this get merged... |
@anhnamtran #2609 effectively replaces this PR. I think it's the better approach than to forcefully reparent the tray window. #2595 only creates a module that can display the tray, it doesn't fix any existing tray issues (not even the ones where the tray is positioned in the wrong place). |
EDIT: Maybe it's a better idea to just make the tray window a child window of polybar. Then repositioning should get a lot easier.
Alternatively, have a main window and have the bar and the tray as two separate child windows.
The restacking issues observed in #1355 and #425 is caused by the WM reparenting the polybar window but not the tray window when
override-redirect = false
. Because of this the two windows are no longer siblings, causing theXCB_MATCH
error.Automatic reparenting causes problems with
tray-offset-*
not being applied in at least openbox and maybe other WMs. The reason for that is that openbox reparents the bar window into a window that hast the same dimensions as the bar window, if we also move the tray under that window, the tray cannot be drawn outside of the bar bounds. My solution here is a somewhat breaking change because by default reparenting is turned on. I think this is fine because it's only a breaking change in WMs that make the bar a child of a window with tight bounds and in configs that use the tray offset to move the tray outside of the bar's bounds. There is no other way to fix two linked issues in those WMs.To not totally break people's configs that may want to move the tray outside of the bar bounds on those WMs, I have introduced a new key in the bar section:
Fixes #1355
Fixes #425
Fixes #1813
Fixes #1995
This fix could also work for #898
This fix could also work for #2460
This fix could also work for #2433
This fix could also work for #1995
This fix could also work for #789
This fix could also work for #1537
Closes #1657
Fixes #2035