Bugfix: Don’t run into an endless loop when killing con with children (Thanks mseed)

When a tabbed container had more than one child and at least the first one
supported WM_DELETE, i3 entered an endless loop when killing that tabbed
container. This was due to tree_close only sending WM_DELETE without actually
removing the child, while the loop in tree_close assumed that with every call
of tree_close one child would be removed.
This commit is contained in:
Michael Stapelberg
2011-05-11 20:22:47 +02:00
parent 7e587f3570
commit eb8ad348b2
2 changed files with 24 additions and 10 deletions

View File

@ -66,10 +66,12 @@ void tree_close_con();
void tree_next(char way, orientation_t orientation);
/**
* Closes the given container including all children
* Closes the given container including all children.
* Returns true if the container was killed or false if just WM_DELETE was sent
* and the window is expected to kill itself.
*
*/
void tree_close(Con *con, bool kill_window, bool dont_kill_parent);
bool tree_close(Con *con, bool kill_window, bool dont_kill_parent);
/**
* Loads tree from ~/.i3/_restart.json (used for in-place restarts).