From ae15be855534496bb251cf23ec8fc6ea9ad34e01 Mon Sep 17 00:00:00 2001 From: Johan Malm Date: Wed, 18 May 2022 16:52:49 +0100 Subject: [PATCH] resistance.c: initialize 'flags' to zero ...in both resistance_resize_apply() and resistance_move_apply() Failure to initialize these variables sometimes causes windows to stick to edges during move/resize. Issues #331 and #309 may be related to this --- src/resistance.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/resistance.c b/src/resistance.c index 11cdfadd..7a54a035 100644 --- a/src/resistance.c +++ b/src/resistance.c @@ -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; @@ -108,7 +108,7 @@ resistance_resize_apply(struct view *view, struct wlr_box *new_view_geo) 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; view_edges.top = view->y - border.top;