]> git.mdlowis.com Git - proto/labwc.git/commitdiff
src/view.c: Allow snapping to the same edge
authorConsolatis <35009135+Consolatis@users.noreply.github.com>
Thu, 22 Dec 2022 02:22:34 +0000 (03:22 +0100)
committerJohan Malm <johanmalm@users.noreply.github.com>
Thu, 29 Dec 2022 22:24:55 +0000 (22:24 +0000)
Reported-by: @Flrian via IRC
Debugged-by: @Flrian
Tested-by: @Flrian
src/view.c

index f520b3e6f5b48e0c6dcd8244c917ad618e2dc029..db326c3ebc515c22eece2087228378b37f4f8ede 100644 (file)
@@ -855,7 +855,22 @@ view_snap_to_edge(struct view *view, const char *direction,
                        edge = view_edge_invert(edge);
                        output = output_from_wlr_output(view->server, new_output);
                } else {
-                       /* No more output to move to */
+                       /*
+                        * No more output to move to
+                        *
+                        * We re-apply the tiled geometry without changing any
+                        * state because the window might have been moved away
+                        * (and thus got untiled) and then snapped back to the
+                        * original edge.
+                        *
+                        * TODO: The described pattern will cause another bug
+                        *       in multi monitor setups: it will snap the
+                        *       window to the inverted edge of the nearest
+                        *       output. This is the desired behavior when
+                        *       caused by a keybind but doesn't make sense
+                        *       when caused by mouse movement.
+                        */
+                       view_apply_tiled_geometry(view, output);
                        return;
                }
        }