Commit graph

3 commits

Author SHA1 Message Date
Andrew J. Hesford
2bf285a2c6 snap: cache and ignore last-snapped edge when growing or shrinking
When growing or shrinking a view by snapping to an edge, a client may
ignore the requested size and instead keep its original size or
substitute a different (possibly constrained) size. In this case, the
view may not actually contact the snapped edge, and a subsequent snap
attempt will just keep re-trying (and failing) to contact the same ege.

To mitigate this, remember the last-snapped view, snapping direction and
offset of the snapping edge in snap.c; when re-attempting a snap for the
same view in the same direction, ignore the edge that was last "hit", to
allow snapping to progress beyond the problematic edge.
2024-04-10 23:30:28 +01:00
Andrew J. Hesford
e7e6d29237 edges, resistance, snap: unified resistance and snapping engine 2024-01-30 15:02:17 -05:00
Axel Burri
1d72a08916 Add snap to window edge framework
Adds functions for calculation of distances between window edges, as
well as for window growing and shrinking.

All calculations are based on the "pending" geometry.

Ignored from snapping:

 - views that do not share the same output
 - minimized views
 - maximized views
 - views that are neither:
   - part of the current workspace
   - part of the always-on-top tree
2023-10-19 19:09:42 +01:00