From 03cc490f0e72c0fddaaccf02641785558ebcabbc Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Mon, 16 May 2011 20:51:29 +0200 Subject: [PATCH] Bugfix: fix crash when disabling floating mode --- src/floating.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/floating.c b/src/floating.c index 2f3f9bac..a60297fc 100644 --- a/src/floating.c +++ b/src/floating.c @@ -179,6 +179,8 @@ void floating_disable(Con *con, bool automatic) { return; } + Con *ws = con_get_workspace(con); + /* 1: detach from parent container */ TAILQ_REMOVE(&(con->parent->nodes_head), con, nodes); TAILQ_REMOVE(&(con->parent->focus_head), con, focused); @@ -190,7 +192,7 @@ void floating_disable(Con *con, bool automatic) { /* 3: re-attach to the parent of the currently focused con on the workspace * this floating con was on */ - Con *focused = con_descend_tiling_focused(con_get_workspace(con)); + Con *focused = con_descend_tiling_focused(ws); /* if there is no other container on this workspace, focused will be the * workspace itself */ -- 2.39.5