Bugfix: Make level up a noop during fullscreen mode (+testcase) (Thanks dothebart)

Fixes #341
This commit is contained in:
Michael Stapelberg
2011-03-09 18:36:45 +01:00
parent 74b90cd83f
commit 86637d2e07
2 changed files with 58 additions and 1 deletions

View File

@ -264,11 +264,17 @@ void tree_split(Con *con, orientation_t orientation) {
*
*/
void level_up() {
/* We cannot go up when we are in fullscreen mode at the moment, that would
* be totally not intuitive */
if (focused->fullscreen_mode != CF_NONE) {
LOG("Currently in fullscreen, not going up\n");
return;
}
/* We can focus up to the workspace, but not any higher in the tree */
if ((focused->parent->type != CT_CON &&
focused->parent->type != CT_WORKSPACE) ||
focused->type == CT_WORKSPACE) {
printf("cannot go up\n");
LOG("Cannot go up any further\n");
return;
}
con_focus(focused->parent);