Skip to content
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

fix(i3): Properly render non-full-width windows #3091

Merged
merged 1 commit into from
Feb 18, 2024

Conversation

patrick96
Copy link
Member

@patrick96 patrick96 commented Feb 11, 2024

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update
  • Other: Replace this with a description of the type of this PR

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)

  • This PR requires changes to the Wiki documentation (describe the changes)
  • This PR requires changes to the documentation inside the git repo (please add them to the PR).
  • Does not require documentation changes

@patrick96 patrick96 added this to the 3.7.2 milestone Feb 11, 2024
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 polybar#3060
Copy link

codecov bot commented Feb 11, 2024

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (0206997) 12.69% compared to head (dec4fd9) 12.70%.

Files Patch % Lines
src/components/renderer.cpp 0.00% 1 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##           hotfix/3.7.2    #3091   +/-   ##
=============================================
  Coverage         12.69%   12.70%           
=============================================
  Files               160      160           
  Lines             12529    12523    -6     
=============================================
  Hits               1591     1591           
+ Misses            10938    10932    -6     
Flag Coverage Δ
unittests 12.70% <0.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@patrick96 patrick96 merged commit c8f7dc1 into polybar:hotfix/3.7.2 Feb 18, 2024
9 checks passed
@patrick96 patrick96 deleted the fix/i3-width branch February 18, 2024 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant