]> git.sur5r.net Git - i3/i3/commitdiff
implement 'fullscreen' command
authorMichael Stapelberg <michael@stapelberg.de>
Sat, 17 Apr 2010 17:29:44 +0000 (19:29 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Sat, 17 Apr 2010 17:29:44 +0000 (19:29 +0200)
src/cmdparse.y

index acac73e2907ec56ee256fb7569ea00283a319fa4..e9b2538c4ddbf224a104f914ba643f7cadc6cdae 100644 (file)
@@ -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(&current_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(&current_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);
+            }
+        }
+
+    }
+    ;