From: Michael Stapelberg Date: Mon, 28 Feb 2011 16:23:50 +0000 (+0100) Subject: Bugfix: Re-attach floating cons to the right container (Thanks mseed) X-Git-Tag: tree-pr2~26 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=d80105103c25c149609dc4ed635a240f8a13b5c9;p=i3%2Fi3 Bugfix: Re-attach floating cons to the right container (Thanks mseed) This fixes #315. --- diff --git a/src/floating.c b/src/floating.c index 25afa832..fac78a0f 100644 --- a/src/floating.c +++ b/src/floating.c @@ -158,7 +158,11 @@ 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_focused(con_get_workspace(con)); - con->parent = focused->parent; + /* if there is no other container on this workspace, focused will be the + * workspace itself */ + if (focused->type == CT_WORKSPACE) + con->parent = focused; + else con->parent = focused->parent; /* XXX: We adjust the percentage value to start with a fair value. Floating * cons always have 1.0 as percent which doesn’t work so well when