layout/scrolling: fix viewport bug when moving window to another workspace#15141
layout/scrolling: fix viewport bug when moving window to another workspace#15141erstarr wants to merge 3 commits into
Conversation
fix bug
|
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. |
…on and rename another.
|
where test |
problem with its creation: noted in desc.
It can wait until that's resolved if the test is non negotiable |
|
pretty much non negotiable for new features / fixes that can be tested. I don't want shit I dont use randomly breaking because I didnt test them |
|
Ok converting to draft for now until I find time to figure out why focus fallback is no worky |
Describe your PR, what does it fix/add?
Misc. Refactoring:
window.active. This one, used when moving a window to a workspace non-silently.Fix a bug with unwanted viewport move when moving a floating window to another workspace
Repo steps:
window: colresize 0.5 | window: colresize 0.8
Move viewport to 0.5 window so that the 0.8 window is partially off the screen
Create a floating window (spawn float or create then restore above config). establish focus history so that when this floating window is sent to another workspace, focus falls back to the 0.8 window
Move the floating window to another workspace with follow=false (special or not). Viewport moves to make 0.8 window fully in view.
This MR fixes that
Also, more focus reasons is good for
window.activetoo and allows for better lua scriptingIs there anything you want to mention? (unchecked code, possible bugs, found problems, breaking compatibility, etc.)
Attempt to create a test: fails inexplicably.
Details
I tried to make tests for this fix. I created 2; same exact code except one has
follow_focus = falseand one= true.The
= truepasses perfectly, but=falsefails because focus fallback does not work for reasons unknown. There are numerous other tests, 2 in scrolling, with focus fallback configured exactly like= falsetest (code exactly the same) yet they all pass.I investigated the codepath also, all places where
follow_focusconfig value is used; the passing scroll test (kill floating window, focus fallback) should fail in the same way if that was the reason but it doesn't.Other than the test stubbornly failing, everything else if fine. Hyprtester's focus behaviour has been fickle in some tests I wrote before.
Is it ready for merging, or does it need work?
Ready
I'll investigate the test failing when I have spare time, but the bugfix for this bug will in any case be the same so this can be merged first