diff --git a/sway/tree/view.c b/sway/tree/view.c
index 05a9b277..87ed62c2 100644
--- a/sway/tree/view.c
+++ b/sway/tree/view.c
@@ -88,6 +88,7 @@ void view_autoconfigure(struct sway_view *view) {
 	}
 
 	double x, y, width, height;
+	x = y = width = height = 0;
 	switch (view->border) {
 	case B_NONE:
 		x = view->swayc->x;