]> git.mdlowis.com Git - proto/labwc.git/commit
snap: cache and ignore last-snapped edge when growing or shrinking
authorAndrew J. Hesford <ajh@sideband.org>
Tue, 2 Apr 2024 19:58:50 +0000 (15:58 -0400)
committerJohan Malm <johanmalm@users.noreply.github.com>
Wed, 10 Apr 2024 22:30:28 +0000 (23:30 +0100)
commit2bf285a2c6ee70a3c796e4384afb7349dcd290bf
treee59eb294844af9da68b947089c55e4f390e9f227
parent9de487cecfe9aec590d62f6302c15db7175fcdaa
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.
include/edges.h
include/snap-constraints.h [new file with mode: 0644]
include/snap.h
src/edges.c
src/interactive.c
src/meson.build
src/resistance.c
src/snap-constraints.c [new file with mode: 0644]
src/snap.c
src/view.c
src/xdg.c