fix(i3): Properly render non-full-width windows #3091
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What type of PR is this? (check all applicable)
Description
Without override-redirect, i3 will not allow you to have a non-full-width bar. But polybar simply ignores that request and continues to render the user-requested width instead of the width i3 has configured the window to be.
With the 3.7 release, we started setting the window's backing pixmap to the rendering pixmap. In the case above, the pixmap would only be allocted for the smaller width and when i3 maps the window, it repeats the backing pixmap to fill the entire window.
At the point where i3 maps the window, the pixmap contains an initial render of the bar without module content and that render is then duplicated.
Reverting back to the old approach of simply copying over the pixmap after each render does not have that problem and the remainder of the bar is black (or fully transparent with a compositor).
Ideally, polybar would respect the width i3 configures for it, but that
would break many existing setups that rely on non-full-width bars in i3
Fixes #3060
Documentation (check all applicable)