Skip to content

scrolling: fix inconsistent column widths at tape edges - #16489

Closed
LuYishan-4 wants to merge 1 commit into
hyprwm:mainfrom
LuYishan-4:scrolling-fix-inconsistent-column-widths-at-tape-edges
Closed

LuYishan-4 wants to merge 1 commit into
hyprwm:mainfrom
LuYishan-4:scrolling-fix-inconsistent-column-widths-at-tape-edges

Conversation

@LuYishan-4

Copy link
Copy Markdown

Describe your PR, what does it fix/add?

Fixes #16422.

In the scrolling layout, the first and last columns on the tape did not receive gaps_in on their outer edge, while columns between them received gaps on both sides.

This caused edge columns to have a different visual width from otherwise identical middle columns. For example, with a symmetric gaps_in of 5px, an edge column was effectively 5px wider than a middle column.

This is incorrect for a scrolling layout because the edges of the tape are not fixed viewport edges: the tape moves relative to the viewport.

This PR removes the per-column left/right edge checks and applies the primary-axis gap consistently to both sides of every column.

For horizontal scrolling:

before:

first:   W - right gap
middle:  W - left gap - right gap
last:    W - left gap

after:

first:   W - left gap - right gap
middle:  W - left gap - right gap
last:    W - left gap - right gap

The same logic is applied to vertical scrolling using the top and bottom gaps.

The existing scrolling tests were also updated to reflect the corrected window sizes and positions.

This also removes the geometry mismatch that could make the viewport appear to self-correct by a few pixels when moving focus between edge and non-edge columns, including cases exposed by fullscreen viewport restoration work such as #16318.

Is there anything you want to mention? (unchecked code, possible bugs, found problems, breaking compatibility, etc.)

Did you use AI in any way shape or form in the making of this PR? If so, detail how you used it. (Undisclosed AI use is a violation of the [AI Policy](https://github.com/hyprwm/.github/blob/main/policies/AI_USAGE.md) and is punishable)

No.

I reviewed the resulting changes and diff before submitting the PR.

Is it ready for merging, or does it need work?

Ready for review.

The fix is intentionally limited to the scrolling gap geometry and the affected test expectations.

In the non-primary axis, gaps were applied based on column
position instead of target position. This caused edge windows
in a scrolling layout to have incorrect sizes and positions
when the layout direction is vertical.
@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown

Hi @LuYishan-4,

Thanks for your contribution! Unfortunately, Hyprland and hypr* no longer
accept contributions from unvouched contributors.

To get vouched, please see our contributing guide at wiki.hypr.land/Contributing-and-Debugging

This PR has been closed automatically and will not be re-opened.

@github-actions github-actions Bot closed this Oct 4, 2026
@erstarr

erstarr commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Thank you for the work.

I reviewed the resulting changes and diff before submitting the PR.

If you didn't use AI, what does this mean?


The patch is good.

Also a test please - should be simple -- have gaps_out != gaps_in (prob just disable gaps_out) and test that extreme cols have the same width as the middle ones.


As for the vouch, pls make the request; your patch is sound.

@LuYishan-4

Copy link
Copy Markdown
Author

I reviewed the resulting changes and diff before submitting the PR.

Sorry, my English isn't very good, so I used AI to write the PR description.

@erstarr

erstarr commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Sorry, my English isn't very good, so I used AI to write the PR description.

You're good.

This is a part of the requirements for the scrolling FS position restore token MR so pls make the vouch request and reopen this after it's given so it can be merged. No real rush ofc since that one also depends on another MR which depends on another which is a fairly big one so it'll be a while till it's relevant -- but it'd be good to have this fix in the next release all the same.

@erstarr

erstarr commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

If you don't want to make a vouch request and reopen this MR, may I add it with you as co-author instead? I would like to have this in upstream.

@LuYishan-4

Copy link
Copy Markdown
Author

Sorry, I’ve been busy dealing with school admissions lately, so I might not have time to handle this.

@LuYishan-4

Copy link
Copy Markdown
Author

如果您不想提交擔保請求並重新開啟此合併請求,我可以將您加入為共同作者嗎?我希望將此合併請求合併到上游。

sure

@erstarr

erstarr commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

I've turned your diff into a patch, preserving your authorship.

#16581

Thank you for the work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scrolling: Left and rightmost columns are wider than those between them by X:3

2 participants