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

feat: Snap Window Edges to Close Output Edges #1189

Merged
merged 4 commits into from
Feb 14, 2025

Conversation

Koranir
Copy link
Contributor

@Koranir Koranir commented Jan 31, 2025

This is a feature that KDE has called "Snap Zones" which I find to be very useful for organizing floating layouts (especially small widgets like the Spotify miniplayer, demonstrated in the video).

When resizing or moving a floating/sticky window, any edge that gets too close to one of the currently active output's edges will be snapped into the output's edge, mitigating any pixel-perfect movements you would have to do otherwise to get window edges to align properly.

magnetc-window.mp4

@Drakulix
Copy link
Member

Drakulix commented Feb 4, 2025

My initial impression of this code-wise is very good. Thanks for working on this!

I'll give it an in-depth review (and most likely merge as is), if @pop-os/ux agrees with this feature.

@Drakulix
Copy link
Member

Drakulix commented Feb 5, 2025

So the verdict is, that we want this behind a cosmic-comp config setting that is off by default (but will be exposed in cosmic-settings).

Could you add this to the PR? If not that is also totally fine, in that case I'll do it, once I have the time.

In any case thanks for working on this 👍

@Koranir
Copy link
Contributor Author

Koranir commented Feb 6, 2025

So the verdict is, that we want this behind a cosmic-comp config setting that is off by default (but will be exposed in cosmic-settings).

Could you add this to the PR?

Done. I've also made the actual snapping distance configurable too.

Copy link
Member

@Drakulix Drakulix left a comment

Choose a reason for hiding this comment

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

Done. I've also made the actual snapping distance configurable too.

Great! I think that makes for a great config option, though we will probably expose this in cosmic-settings purely as a toggle for now.

@Drakulix Drakulix merged commit 2553810 into pop-os:master Feb 14, 2025
3 checks passed
@Drakulix
Copy link
Member

Thanks again!

@Koranir
Copy link
Contributor Author

Koranir commented Feb 14, 2025

Aur naur, I forgot to rename the window_snap_threshold field/argument names for the MoveGrabs. Not a bug or anything but it's inconsistent naming :P

@Drakulix
Copy link
Member

Aur naur, I forgot to rename the window_snap_threshold field/argument names for the MoveGrabs. Not a bug or anything but it's inconsistent naming :P

If you feel like it, feel free to submit a PR correcting that. :)

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.

2 participants