display: snap monitors to aligned centers in the arrangement view - #384
Open
ggiesen wants to merge 1 commit into
Open
display: snap monitors to aligned centers in the arrangement view#384ggiesen wants to merge 1 commit into
ggiesen wants to merge 1 commit into
Conversation
When dragging a monitor in the Display arrangement panel, also offer snap positions that align the dragged monitor's center with an adjacent monitor's center -- both stacked (top/bottom) and side by side (left/right). Until now only edges snapped, so two monitors of different sizes could not be centered relative to each other by dragging, even though muffin accepts the resulting centered-but-abutting layout as valid. This adds four center-aligned candidates in find_best_snapping(), alongside the existing edge candidates. The stacked (horizontal-center) case matches the approach gnome-control-center took; the side-by-side (vertical-center) case extends the same idea to the vertical axis.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
In the Display arrangement panel, dragging a monitor now also snaps to positions that align its center with an adjacent monitor's center -- both stacked (top/bottom) and side by side (left/right) -- alongside the existing edge snaps.
Why
Currently only edges snap, so two monitors of different sizes cannot be centered relative to each other by dragging; you can only line up their top/bottom or left/right edges. A centered-but-abutting arrangement is a valid layout (muffin accepts it), so this is a UI-only gap.
How
Four center-aligned candidates are added in
find_best_snapping()(panels/display/cc-display-arrangement.c) asSNAP_DIR_BOTHpeers of the existing edge candidates:Prior art
GNOME's gnome-control-center added the stacked (horizontal-edge) center-snap in commit
3070866d("display-arrangement: Add center-aligned snapping for horizontal edges", 2026-06-22). This brings that case to Cinnamon and additionally adds the side-by-side (vertical-edge) center case, which GNOME does not have.Testing
Built and drag-tested on Linux Mint 22 (Cinnamon, X11): a smaller monitor now snaps to vertically-centered when placed beside a larger one, and horizontally-centered when stacked, in addition to the edge snaps. No backend change required.