]> git.mdlowis.com Git - proto/labwc.git/commitdiff
resistance.c: initialize 'flags' to zero
authorJohan Malm <jgm323@gmail.com>
Wed, 18 May 2022 15:52:49 +0000 (16:52 +0100)
committerJohan Malm <jgm323@gmail.com>
Wed, 18 May 2022 15:52:49 +0000 (16:52 +0100)
Failure to initialize this variable sometimes causes windows to stick to
edges during move/resize.

Issues #331 and #309 may be related to this

src/resistance.c

index 4a3d99bac1690ad881c974ec98e042fc78ef1ab7..a1d2aba48a27065b9f0abf63de3ea7aa44d62a06 100644 (file)
@@ -44,7 +44,7 @@ resistance_move_apply(struct view *view, double *x, double *y)
        struct edges view_edges; /* The edges of the current view */
        struct edges target_edges; /* The desired edges */
        struct edges other_edges; /* The edges of the monitor/other view */
-       struct edges flags; /* To be set in is_within_resistance_range() */
+       struct edges flags = { 0 };
 
        view_edges.left = view->x - border.left + 1;
        view_edges.top = view->y - border.top + 1;