Skip to content

view: consolidate group flags and apply window rules#13694

Merged
vaxerski merged 3 commits into
hyprwm:mainfrom
kaosuran:fixes/fix-group-flags
Mar 17, 2026
Merged

view: consolidate group flags and apply window rules#13694
vaxerski merged 3 commits into
hyprwm:mainfrom
kaosuran:fixes/fix-group-flags

Conversation

@kaosuran

@kaosuran kaosuran commented Mar 11, 2026

Copy link
Copy Markdown
Contributor

Hi,
noticed a regression since the Groups refactor (#13460), after some poking I think I've finally found the solution, albeit I'm not sure if I'm doing it properly, sorry, I'm new to this codebase!

I've built it and tested it locally and it seemingly works, the group rules are being applied again.

As now the code's using bitmasks and a flags holder, the m_locked and m_deny became redundant (I've tried setting them with the bitmasks, but that wouldn't work for some reason..?).

Wasn't able to test it properly with hyprtester unfortunately, had some luck running it using Xephyr, but it'd fail on tests that'd assume I have kitty terminal emulator installed etc., not sure how to run it properly, wouldn't work from a fresh TTY either.. but ctest passed.

Replace individual boolean flags with a bitmask for group policies and ensure that window-specific group rules are correctly inherited when windows are initialized or added to a group.
@github-actions

Copy link
Copy Markdown

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

Copy link
Copy Markdown
Member

can you please write some tests for this? :)

@kaosuran

Copy link
Copy Markdown
Contributor Author

can you please write some tests for this? :)

I will try later, but I can't promise anything, hyprtester isn't working right for me :/ will try running it under a VM, maybe it'll stop crashing like crazy.

kaosuran and others added 2 commits March 16, 2026 17:47
Add tests to verify window grouping behavior, specifically checking that locked groups prevent merging by default and that the 'invade' group rule correctly overrides this lock policy.
@kaosuran

kaosuran commented Mar 16, 2026

Copy link
Copy Markdown
Contributor Author

can you please write some tests for this? :)

Hello again, sorry it took so long, I've added 3 tests:

  1. Check behavior for regular groups, make sure they merge normally
  2. Check behavior for locked groups, make sure they don't merge
  3. Check behavior for locked groups with invade rule, make sure they do merge

Testing locally I got:

Passed: Tests::windowCount(). Got 0
Passed: getFromSocket("/dispatch togglegroup"). Got ok
Passed: str contains "at: 22,22" 2 times.
Passed: Tests::windowCount(). Got 0
Passed: getFromSocket("/dispatch togglegroup"). Got ok
Passed: getFromSocket(std::format("/dispatch focuswindow pid:{}", lockedWin->pid())). Got ok
Passed: getFromSocket("/dispatch lockactivegroup lock"). Got ok
Passed: str contains "at: 22,22" 1 times.
Passed: Tests::windowCount(). Got 0
Passed: getFromSocket("/keyword windowrule[locked-im]:match:class ^locked|invade$"). Got ok
Passed: getFromSocket("/keyword windowrule[locked-im]:group set always lock invade"). Got ok
Passed: str contains "at: 22,22" 2 times.
Passed: Tests::windowCount(). Got 0

The clang CI seemingly fails due to the main upstream changes 🙏🏻
Please let me know if there's something else I should do, thanks for your time!

@vaxerski vaxerski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtv

@vaxerski
vaxerski merged commit be96e06 into hyprwm:main Mar 17, 2026
8 of 10 checks passed
vaxerski pushed a commit that referenced this pull request Mar 27, 2026
* view: consolidate group flags and apply window rules

Replace individual boolean flags with a bitmask for group policies and ensure that window-specific group rules are correctly inherited when windows are initialized or added to a group.

* tests: add cases for locked groups and invade rule

Add tests to verify window grouping behavior, specifically checking that locked groups prevent merging by default and that the 'invade' group rule correctly overrides this lock policy.
crthpl pushed a commit to crthpl/Hyprland that referenced this pull request Jun 3, 2026
* view: consolidate group flags and apply window rules

Replace individual boolean flags with a bitmask for group policies and ensure that window-specific group rules are correctly inherited when windows are initialized or added to a group.

* tests: add cases for locked groups and invade rule

Add tests to verify window grouping behavior, specifically checking that locked groups prevent merging by default and that the 'invade' group rule correctly overrides this lock policy.
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