Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config: Add a variable to prevent groups from merging after being dragged #7650

Merged
merged 2 commits into from
Sep 5, 2024

Conversation

Sonotsugipaa
Copy link
Contributor

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) is true, 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 moveoutofgrouping 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.

vaxerski
vaxerski previously approved these changes Sep 5, 2024
Copy link
Member

@vaxerski vaxerski left a comment

Choose a reason for hiding this comment

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

wiki mr needed

@Sonotsugipaa
Copy link
Contributor Author

I see that the code style is wrong, as I suspected - I'll work on that and the wiki right away.

@Sonotsugipaa
Copy link
Contributor Author

Sonotsugipaa commented Sep 5, 2024

... done.

I also have the code style related change downstream, should I convert this PR to a draft and change it that way?

@Sonotsugipaa
Copy link
Contributor Author

Nevermind, I figured it out - forgive my clumsiness, I don't have much experience with PRs.

@vaxerski vaxerski merged commit 4a42c5e into hyprwm:main Sep 5, 2024
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