config: Add a variable to prevent groups from merging after being dragged #7650
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Describe your PR, what does it fix/add?
The PR adds a config variable that (dis)allows window groups from being "swallowed" into other groups when being dragged over them.
This setting does not prevent ungrouped windows from being dragged into groups.
The default value of the variable (
merge_groups_on_drag
) istrue
, which reflects the behavior of Hyprland prior to this change.Is it ready for merging, or does it need work?
It is ready for merging.
Is there anything you want to mention? (unchecked code, possible bugs, found problems, breaking compatibility, etc.)
Code Style
I tried to follow the code style as seen, but the PR Guidelines page on the wiki only mentions the
/.clang-format
file and I'm not sure I got VSCode to use it; still, I did my best to follow it.Implementation
I implemented the check in
CWindow::canBeGroupedInto
(/src/desktop/Window.cpp
), but I am not familiar with the codebase so I'm not entirely sure that's the correct place for it.Rationale
My usual workflow has two window groups, with one being the "master" (despite using the dwindle layout); I also use a mouse binding to to drag windows.
When I want to move a window from one group to the other, my muscle memory has me
moveoutofgroup
ing the window, then swiftly dragging it to its target.However, occasionally I accidentally press the wrong keys, forget to press the right keys, or even simply twitch and click twice.
This means that the window group, often containing up to ~8 windows, "hovers" above the other group for a split second, and I end up with one big group containing everything;
consequently, I need to manually sort the windows back to the previous layout if I can even remember it.
You could prevent this from happening by locking groups or preventing ungrouped windows from joining them, but doing so is still either prone to whoopsies or much slower than having this PR's config variable set to
false
.Still, as far as I could gather from social media, I seem to be the only person to have ever had this issue; someone suggested doing this was already possible, but when I asked for clarification, silence followed.