Skip to content

Conversation

@lichie567
Copy link
Contributor

@lichie567 lichie567 commented Dec 10, 2025

Describe your PR, what does it fix/add?

This PR is a follow up to this one: #12518

I decided to take a new approach so I created a new PR. The issue is described at length in the PR linked above, but I'll shortly describe the issue again.

move and center rules are separate effects that both affect the position of a window, which causes undefined behavior when both rules are inherited by the same window. Intuitively, the one defined "last" should take precedence, but currently that isn't the case. The center rule always takes precendence because that effect is applied later in the code.

While investigating I found it odd that defining center off as a rule did not seem to work, as from looking at the code it seemed like it should. However I eventually realized the center field in the struct was declared as an std::optional<int> which has a truthy value even when assigned an explicit value of false. 🤦

I decided to just always unset the other effect when setting either move or center. While this is probably the simplest way to fix this, I still don't consider it the cleanest way.

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

No

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

Should be ready to merge

@github-actions
Copy link

Hello and thank you for making a PR to Hyprland!

Please check the PR Guidelines and make sure your PR follows them.
It will make the entire review process faster. :)

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.

vaxerski
vaxerski previously approved these changes Dec 14, 2025
@vaxerski
Copy link
Member

conflict

@lichie567
Copy link
Contributor Author

should be good to go now

@vaxerski vaxerski merged commit 18901b8 into hyprwm:main Dec 17, 2025
10 checks passed
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.

2 participants