Commit a9351cb5 authored by Benjamin Berg's avatar Benjamin Berg Committed by Georges Basile Stavracas Neto

display: Correctly add minor axis to snapping

There was an issue where the "minor" axis snapping would not be done if
the "major" axis snapping had a zero distance. This could be seen when e.g.
moving a monitor on the right up/down slightly. In that case, no
snapping to align the bottom/top edges were done unless you also moved
the mouse sideways a bit.

Fixes #211


(cherry picked from commit 22a512f0)
parent f6f29554
Pipeline #33856 passed with stages
in 4 minutes and 19 seconds
......@@ -279,6 +279,13 @@ maybe_update_snap (CcDisplayArrangement *self,
{
update_snap = SNAP_DIR_BOTH;
}
/* Also allow a minor axis to be added if the first axis remains identical. */
if (((snap_data->snapped == SNAP_DIR_X) && (major_axis == SNAP_DIR_X) && (new_x == snap_data->mon_x)) ||
((snap_data->snapped == SNAP_DIR_Y) && (major_axis == SNAP_DIR_Y) && (new_y == snap_data->mon_y)))
{
update_snap = SNAP_DIR_BOTH;
}
}
else if (snapped == SNAP_DIR_X)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment