From 1a62c398ac210b4b6110320d57b2df309293b868 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Tue, 7 Aug 2012 01:13:37 +0200 Subject: [PATCH] Bugfix: Attach con to nc before calling con_border_style_rect() --- src/floating.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/floating.c b/src/floating.c index 1f0925f3..85ca7a5a 100644 --- a/src/floating.c +++ b/src/floating.c @@ -175,6 +175,12 @@ void floating_enable(Con *con, bool automatic) { nc->rect.width = max(nc->rect.width, config.floating_minimum_width); } + /* 3: attach the child to the new parent container. We need to do this + * because con_border_style_rect() needs to access con->parent. */ + con->parent = nc; + con->percent = 1.0; + con->floating = FLOATING_USER_ON; + /* Add pixels for the decoration. */ Rect border_style_rect = con_border_style_rect(con); @@ -223,10 +229,6 @@ void floating_enable(Con *con, bool automatic) { DLOG("Floating rect: (%d, %d) with %d x %d\n", nc->rect.x, nc->rect.y, nc->rect.width, nc->rect.height); - /* 3: attach the child to the new parent container */ - con->parent = nc; - con->percent = 1.0; - con->floating = FLOATING_USER_ON; /* 4: set the border style as specified with new_float */ if (automatic) -- 2.39.5