From 0ea85c1b9d720a229c8ac02aa0cde92fcb28a66e Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sat, 17 Apr 2010 19:29:44 +0200 Subject: [PATCH] implement 'fullscreen' command --- src/cmdparse.y | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/src/cmdparse.y b/src/cmdparse.y index acac73e2..e9b2538c 100644 --- a/src/cmdparse.y +++ b/src/cmdparse.y @@ -238,7 +238,6 @@ operation: /*| reload | restart | mark - | fullscreen | layout | border | mode @@ -249,6 +248,7 @@ operation: | focus | kill | open + | fullscreen ; exec: @@ -285,14 +285,14 @@ kill: owindow *current; printf("killing!\n"); - /* TODO: check if the match is empty, not if the result is empty */ + /* check if the match is empty, not if the result is empty */ if (match_is_empty(¤t_match)) tree_close(focused); else { - TAILQ_FOREACH(current, &owindows, owindows) { - printf("matching: %p / %s\n", current->con, current->con->name); - tree_close(current->con); - } + TAILQ_FOREACH(current, &owindows, owindows) { + printf("matching: %p / %s\n", current->con, current->con->name); + tree_close(current->con); + } } } @@ -314,3 +314,22 @@ open: tree_open_con(NULL); } ; + +fullscreen: + TOK_FULLSCREEN + { + printf("toggling fullscreen\n"); + owindow *current; + + /* check if the match is empty, not if the result is empty */ + if (match_is_empty(¤t_match)) + con_toggle_fullscreen(focused); + else { + TAILQ_FOREACH(current, &owindows, owindows) { + printf("matching: %p / %s\n", current->con, current->con->name); + con_toggle_fullscreen(current->con); + } + } + + } + ;