add new focus_fit_method: clamped_center#13345
add new focus_fit_method: clamped_center#13345egormalyutin wants to merge 2 commits intohyprwm:mainfrom
Conversation
|
Hello and thank you for making a PR to Hyprland! Please check the PR Guidelines and make sure your PR follows them. If your code can be tested, please always add tests. See more here. beep boop, I'm just a bot. A real human will review your PR soon. |
CScrollingAlgorithm::layoutMsg
|
This is really interesting, I could definitely see myself using it. Appreciate the work you've done! |
|
@nnra6864 you want something like this? 2026-02-24.11-57-29.mp4As you see here, if the tape fits into viewport, windows are centered "as a whole". However there's another possibility - to always align viewport with the centered window, even if windows fit into viewport: 2026-02-24.12-00-41.mp4I think it's better to give the user the both choices. Also now I think it's better to remove What's causing your issue is |
|
Also I kinda don't like that current scrolling code assumes that user scrolls the tape using keyboard or whatever or by focusing nearby clients. I don't think there's currently a way to scroll using mouse wheel or touchpad gestures without causing viewport alignment, just like I scroll a page in my browser? |
|
What you implemented above is exactly what I was talking about, it's perfect! |
|
@nnra6864 okay. I'm currently not sure how to organize my changes, as I noticed some other scroll related bugs and fixed them (and for some I did not 🤪), so maybe I'll split them into different PRs or idk. I'm not really familiar with this code base very much and vaxry seems to frequently change some things so idk what are the chances of these changes ending up in the upstream |
|
rebase needed |
Describe your PR, what does it fix/add?
I like
centerfocus_fit_method, however I think it looks cringy when I focus the last strip:2026-02-23.19-22-06.mp4
This PR adds a new
focus_fit_methodcalledclamped_center(2) which combines best of the fit and center worlds:2026-02-23.19-22-44.mp4
No ugly empty space past the last strip now.
I also removed some code duplicating the
centerOrFitColcontents.Is there anything you want to mention? (unchecked code, possible bugs, found problems, breaking compatibility, etc.)
Is it ready for merging, or does it need work?
Idk seems to work