From: Michael Stapelberg Date: Mon, 16 May 2011 18:51:29 +0000 (+0200) Subject: Bugfix: fix crash when disabling floating mode X-Git-Tag: tree-pr3~20 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=03cc490f0e72c0fddaaccf02641785558ebcabbc;p=i3%2Fi3 Bugfix: fix crash when disabling floating mode --- 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 */