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

Add snapping to floating windows #3236

Closed
wants to merge 14 commits into from
Closed

Add snapping to floating windows #3236

wants to merge 14 commits into from

Conversation

shadowmax31
Copy link
Contributor

Describe your PR, what does it fix/add?

Adds a floating window snapping option: #3230

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

It adds 3 configuration options:

  1. misc:snap_floating: Enable snapping to either the windows or the monitor's edge (values: "", monitor, windows)
  2. misc:snap_floating_strength: determines the distance at which snapping occurs
  3. misc:snap_floating_outside: if false, windows will only snap to the inside of windows/monitor. If true, windows will snap inside and outside. I disabled it by default, because it reacts a bit weird depending on gap size and strength. Especially if strength is bigger then gap size.

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

Ready

Windows can snap to monitor or other windows. Currently, the left side
is checked against the left side only (same for the all sides).
Otherwise snapping does not working in some cases on window overlap
This could be added to allow snapping outside of a window, but it feels
a bit weird / buggy depending on the gap size. So, I'll leave it out for
now.
```
else if (isInRangeForSnapping(maxSide, boundingMinSide, snap)) {
  newPosition = boundingMinSide - size;
}
else if (isInRangeForSnapping(minSide, boundingMaxSide, snap)) {
  newPosition = boundingMaxSide;
}
```
This is off by default because it can be weird depending on snapping
strength and gap size
@vaxerski
Copy link
Member

request my review when ready

@Oglo12
Copy link

Oglo12 commented Sep 25, 2023

@shadowmax31 Why did you close the snapping windows PR?

@shadowmax31
Copy link
Contributor Author

@Oglo12 Check my last comment on #3230

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants