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]: XWorkspaces does not refresh the viewport list #2693
Comments
In addition to the output of |
Here it is. The polybars have pinned-workspaces = true. Mind you that polybar does get it the workspaces to display right, but only at startup, as the workspaces change around their viewport the bar does not update them afterwards. First focus is on worspace 1, right screen (0 1366) and the other visible workspace is on the left monitor (0 0). I launched the 2 polybars with this setup.
The polybar on the right monitor (0 1366) displays 1 3 4 5 6 7 7 8 9
The window manager was set the workspace 3 and all the other workspaces except 1 to be displayed on the left polybar. Yet the left polybar only shows workspace 2, and the right polybar still shows workspace 1 3 4 5 6 7 8 9. The correct thing to show would be that the left polybar now shows 2 3 4 5 6 7 8 9 and the right polybar shows only workspace 1. |
Thanks for the detailed info :) Can you try out PR #2698, it should update the module whenever you change |
It works amaizingly. Now practically any window manager that uses _NET_DESKTOP_VIEWPORT under the sun works amazingly out of the box with polybar. |
is it possible to add a label-visible for the pin-workspaces option? So we can apply a different underline or color to the workspaces that are visible in the other monitors |
Thanks for testing :)
The xworkspaces module doesn't have |
You are right that it does not work with the spec. It is possible but you have to get cooperation from the window manager. For instance, I can make my window manager set the invisible workspaces to a viewport that is outside all monitors (in my case 3000,3000 makes those workspaces be ignored when pin-workspaces is on) and just set for the current and visible workspace the correct viewport. That way, polybar only has to check the workspace that its on its same viewport to label it visible. But I don't know if most window managers have thought of doing that hack with setting the viewport of invisible workspaces outside of the screens. |
I think adding unofficial extensions to the spec creates a lot of problems. For example, your hack does not work for window managers that assing non-visible desktops to monitors and thus also breaks The official spec would need to be extended for this to work, otherwise there is no way WMs get on board with adding these kinds of extensions. Unfortunetaly, there doesn't seem to be much interest in extending the spec: https://gitlab.freedesktop.org/xdg/xdg-specs/-/merge_requests/22#note_395708 |
Checklist
Steps to reproduce
I believe qtile has the same behaviour, where our workpaces change their viewports dynamically, depending on the monitor we display them.
Minimal config
Polybar log
No response
Expected behavior
Since the pinned workspaces implementation of polybar right now, does not expect workspaces to have their viewports dynamically, I think xworkspaces module should refresh it when it changes.
Actual behavior
See how polybar, when it is started, reads the list of workspaces and their viewports. When pinned-workspaces is on, polybar would include in its workspace list, only the workspaces that were on its monitor during startup and not update with the changing net_desktop_viewport
Window Manager and Version
xmonad with ewmh and my _net_desktop_viewport implementation
Linux Distribution
gentoo
Polybar version
Additional Context / Screenshots
I believe any wm with viewport support and tags that are shared in all monitors support ewmh this way.
Here it is a SS of wmctl -d when the current focused monitor is in workspace 1 (the 0 1366 viewport) and the other visible monitor is resting with workspace 2 (0 0 viewport). (mind the other non visible workspaces I like setting them in the focused monitor viewport, so that polybar maybe if this resolves, has close to my eye the workspaces I might go)
Now this is what happens when I switch the tags across my monitors. See how workspace 1 and 2 have had their viewports switched (ignore the hidden workspaces 3 - 9)
If you want to run this with xmonad, you have to include the viewport support on your log hook with these 2 functions
and also add this into the startup hook
The text was updated successfully, but these errors were encountered: