From: Andrew J. Hesford Date: Tue, 23 Jan 2024 00:04:16 +0000 (-0500) Subject: interactive: reset tiled state when dragging out of snapped position X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=9f51384b6ac73dba404b636f356bf942a772a14d;p=proto%2Flabwc.git interactive: reset tiled state when dragging out of snapped position This ensures that client-side decorations (and maybe other client behaviors) behave intuitively during interative moves, but means that drag to snapped position -> drag to maximize -> un-maximize will put the window back to its natural geometry (saved before the first snap) rather than back to the snapped position. This is a change in behavior, but a) simplifies the logic a bit, because the tiled state is always in sync with the window geometry and b) in some sense is "more correct", because the window has been "visually" un-tiled the minute the window starts dragging. Note that maximizing using an action (including the button) a window that has been snapped and then un-maximizing the window will put the window back to the snapped position, as it always has. --- diff --git a/src/interactive.c b/src/interactive.c index b09ba01c..432027a6 100644 --- a/src/interactive.c +++ b/src/interactive.c @@ -69,6 +69,7 @@ interactive_begin(struct view *view, enum input_mode mode, uint32_t edges) geometry.height); view_set_shade(view, false); + view_set_untiled(view); view_restore_to(view, geometry); } else { /* Store natural geometry at start of move */ @@ -201,9 +202,8 @@ interactive_finish(struct view *view) } if (view->server->input_mode == LAB_INPUT_STATE_MOVE) { - /* Reset tiled state if not snapped */ - if (!snap_to_region(view) && !snap_to_edge(view)) { - view_set_untiled(view); + if (!snap_to_region(view)) { + snap_to_edge(view); } }