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
Stabilize tray module #2689
Comments
Since we now have experimental support in the feature branch we should probably add some documentation on how to use it. I think adding a new module in the wiki sidebar would probably be the best solution with a big experimental warning on top. |
I don't think documentation is crucial at the moment. Especially since any settings inside the tray module may well change again. We should probably hold off writing documentation until at least the config settings are stable. |
Could you still provide a short example of how to use it? I would like to try it. |
@tiagovla Added it to the post. |
I thought a bit about the remaining issues and I have some questions/comments.
Right now a lot of logic is split between the tray_manager and the tray module with no way of them interacting(Besides signals). This complicates a lot but I can't think of a way to simplify this short of moving the tray_manager completely into the tray module. I'm unsure how "clean" we should implement these things since some(like the tray_position) will be removed later which cleans up a lot of code. |
I didn't formulate that clearly, I meant whether the dispatch called Modules can be hidden using module actions (for example using polybar-msg).
The tray can't really check this. But what we can do, is pass this information from the controller to
For text that doesn't fit onto the bar, we render a fading out gradient at the end of the bar when the left, right, and center blocks are placed on the bar: polybar/src/components/renderer.cpp Lines 325 to 349 in 6a2d7b5
However, for the tray, my idea was to not have this logic in the renderer but in the tray itself.
I think we should go with the first option, the tray manager should be responsible for loading its own configuration options. This could be achieved by passing the name of the tray module to If we didn't have to still support |
I decided to just store the tray module name since we need that anyways for the formatting options |
With the tray becoming a module, is it possible that true transparency could be added (as per #2086 (comment))? Not to impose more features on this issue, just curious as to the possibility/complexity as someone without much understanding of X/WMs. |
I also barely know anything about X and window managers 😅 so I'm probably not really qualified to answer that. The changes we added in these PRs are basically one big hack. As you might know the tray right now is a separate window overlayed over the bar window. Instead of removing this window and incorporating the tray into the bar, we decided to internally create blank a module with the same size as the tray window. The tray window is then just moved over the blank window in the bar. Therefore, the tray now behaves like a normal module but is still a separate window. I think that since we only change the window position the same problem still remains with true transparency, although @patrick96 probably knows a lot more about it. I hope this helps! |
Sorry for the radio silence, I have been swamped the past few weeks. I appreciate your work on this 😃 I should have some time to start reviewing stuff again next week, but I will only be around sporadically for at least a month or two.
👍
True transparency remains as difficult as it has before, this "new" tray module didn't really change how the tray is rendered, just where it is placed on the bar. I am considering adding back true transparency in #2609, but no promises.
I don't think we will ever get away from doing it like this. Since each tray icon is a separate window, we have to somehow overlay them over the bar window. |
I'll look over/reorganize my existing PRs till next week and try to finish the settings one. Since the plan is to release this feature with 3.7. What's your timetable for that release? |
There is no fixed timeline. It is mainly tied to which features I want in it. In the 3.6 blog post I said that I wanted to have a fixed tray, new font renderer, and some config syntax improvements in 3.7. But it is starting to look like that will be take too much time for a single release (I really want to release more often than every 12 months). So I think we should release 3.7 once the tray module is stable and I am finished with #2609. I do want to finish #2609 before 3.7 because it will result in some breaking tray changes (basically if you had the tray anywhere outside of the bar window, this will no longer work) and if people should migrate to the module anyway that won't be a big problem. |
The tray is automatically started if there is a tray module. In addition, `tray-position` and the tray module conflict. Ref #2689
I have started building polybar from source and using the unstable tray module, and I must say, it works quite well until now. |
@quantenzitrone I have also noticed this and I think I no longer see this in #2609. However certain applications still have that issue (dropbox for me) and I have not yet found a way to make them behave (I am not even sure if a way exists). I have also decided to not implement true transparency for the tray icons because we would have to do the compositing ourselves and couldn't use a compositor like picom and I don't have the time to do that. |
They are noted in polybar#2689
With #2595 being merged, there are a few steps to make the tray module stable.
The goal is to completely deprecate positioning the tray without a module (and all
tray-*
settings in the bar section).%{Pt}
tag) is set in the renderer. This is needed to deal with hiding modules.tray-position = adaptive
again and just activate the tray when a tray module exists (or one of the other positions is set). The existence of a tray module should override any value fortray-position
. In particular, if a tray module exists andtray-position
is set, a warning or error should be printed.tray-position
and all other tray settings in the bar section. Deprecate legacy tray options #3002It's probably easiest to implement each of these in a separate PR to keep complexity low. The order shouldn't matter except that the last one should be done last.
If we don't make the tray stable before the 3.7 release, polybar should also emit a warning whenever the tray module is used so that people are aware that the tray module may break again in the future.
For those wanting to test it out right now, I'll also add a minimal example for how to add the tray module. All of this is experimental and any config options may change before the tray becomes stable.
We could now also completely change the tray behavior if the module is used without it being a breaking change. In the
tray_manager
we could have a flagin_module
that can be used to differentiate between behavior for the old tray or the module.We should consider taking advantage of this, especially for formatting.
tray-spacing
, which determines the spacing between the icons (tray-padding
kind of does this already but the padding is also added at the beginning and end of the tray window.tray-padding
should now be applied to the left and right of each individual icon (just as what happens for regular labels). Only supports points and pixelstray-maxsize
andtray-scale
should be merged into a single option. They both affectclient_height
, whiletray-maxsize
also increases spacing. This can be made cleaner. There should probably be just a singletray-size
option (percentage with offset relative to bar height, defaults to 66%) and the final icon height and width ismin(bar_heigh, tray-size)
.tray-background
should be discouraged. Make it clear that it will only affect tha background of individual icons, not the spacing in between.This would help fix #1207 I think.
The following tray settings will not have any equivalent setting in the module:
tray-detached
: Not really sure what the use-case for this ever wastray-transparent
: Already deprecated and has no effecttray-offset-x
: Can be achieved with format offsets and offset tags.tray-offset-y
: Due to the tray being subwindows now, it cannot be moved outside of the bar area anyway. If people want to vertically position icons within the bar, we could introduce atray-alignmnent
setting.The new tray module would also be a workaround for #651, as long as there is enough padding before or after the tray module.
Linked Issues & PRs
The text was updated successfully, but these errors were encountered: