]> git.sur5r.net Git - i3/i3/blobdiff - src/commands.c
Implement a command for hiding all floating windows (and showing them again)
[i3/i3] / src / commands.c
index d809c81a7c9beb8863c8c5fe3cdb41240d9af85a..fb3c5422ea273102d9c7fc79619cd031f358f4ae 100644 (file)
@@ -625,12 +625,9 @@ void show_workspace(xcb_connection_t *conn, int workspace) {
                         xcb_map_window(conn, client->frame);
 
         /* Map all floating clients */
-        SLIST_FOREACH(client, &(c_ws->focus_stack), focus_clients) {
-                if (client->floating <= FLOATING_USER_OFF)
-                        continue;
-
-                xcb_map_window(conn, client->frame);
-        }
+        if (!c_ws->floating_hidden)
+                TAILQ_FOREACH(client, &(c_ws->floating_clients), floating_clients)
+                        xcb_map_window(conn, client->frame);
 
         /* Map all stack windows, if any */
         struct Stack_Window *stack_win;
@@ -854,6 +851,12 @@ void parse_command(xcb_connection_t *conn, const char *command) {
                 return;
         }
 
+        if (command[0] == 'H') {
+                LOG("Hiding all floating windows\n");
+                floating_toggle_hide(conn, c_ws);
+                return;
+        }
+
         enum { WITH_WINDOW, WITH_CONTAINER, WITH_WORKSPACE } with = WITH_WINDOW;
 
         /* Is it a <with>? */