From: hwangcc23 Date: Tue, 22 Sep 2015 15:04:10 +0000 (+0800) Subject: Not toggle floating on a CT_FLOATING_CON X-Git-Tag: 4.11~6^2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=refs%2Fpull%2F1952%2Fhead;p=i3%2Fi3 Not toggle floating on a CT_FLOATING_CON See the issue #1875. Forbid the command to toggle floating on a CT_FLOATING_CON to avoid the crash. --- diff --git a/src/floating.c b/src/floating.c index 67c3a1b8..d7a33067 100644 --- a/src/floating.c +++ b/src/floating.c @@ -369,6 +369,12 @@ void floating_disable(Con *con, bool automatic) { * */ void toggle_floating_mode(Con *con, bool automatic) { + /* forbid the command to toggle floating on a CT_FLOATING_CON */ + if (con->type == CT_FLOATING_CON) { + ELOG("Cannot toggle floating mode on con = %p because it is of type CT_FLOATING_CON.\n", con); + return; + } + /* see if the client is already floating */ if (con_is_floating(con)) { LOG("already floating, re-setting to tiling\n");