Fix crash when trying to split and float a dock container.
Since splitting a docking container was allowed and successful, the check to prevent floating it fails to work. This causes a crash because the workspace of the container cannot be determined as the dockarea is higher up in the tree than the workspace it belongs to. This patch extends to sanity check to nested dock containers when trying to float a container and also disallows manually splitting a docked container or changing its layout. fixes #2034
This commit is contained in:
14
src/con.c
14
src/con.c
@ -448,6 +448,20 @@ bool con_is_floating(Con *con) {
|
||||
return (con->floating >= FLOATING_AUTO_ON);
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns true if the container is a docked container.
|
||||
*
|
||||
*/
|
||||
bool con_is_docked(Con *con) {
|
||||
if (con->parent == NULL)
|
||||
return false;
|
||||
|
||||
if (con->parent->type == CT_DOCKAREA)
|
||||
return true;
|
||||
|
||||
return con_is_docked(con->parent);
|
||||
}
|
||||
|
||||
/*
|
||||
* Checks if the given container is either floating or inside some floating
|
||||
* container. It returns the FLOATING_CON container.
|
||||
|
Reference in New Issue
Block a user