From 1a40641462ae29299f5f09536febe4f4a9304933 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Mon, 29 Nov 2010 22:32:19 +0100 Subject: [PATCH] workspace.{c,h}: remove obsolete code --- include/workspace.h | 14 ------ src/workspace.c | 119 -------------------------------------------- 2 files changed, 133 deletions(-) diff --git a/include/workspace.h b/include/workspace.h index a2c1836e..f65f1494 100644 --- a/include/workspace.h +++ b/include/workspace.h @@ -99,18 +99,4 @@ void workspace_map_clients(xcb_connection_t *conn, Workspace *ws); */ void workspace_update_urgent_flag(Con *ws); -#if 0 -/* - * Returns the width of the workspace. - * - */ -int workspace_width(Workspace *ws); - -/* - * Returns the effective height of the workspace (without the internal bar and - * without dock clients). - * - */ -int workspace_height(Workspace *ws); -#endif #endif diff --git a/src/workspace.c b/src/workspace.c index a1d3659d..9ce28e52 100644 --- a/src/workspace.c +++ b/src/workspace.c @@ -450,93 +450,6 @@ Workspace *get_first_workspace_for_output(Output *output) { return result; } -/* - * Maps all clients (and stack windows) of the given workspace. - * - */ -void workspace_map_clients(xcb_connection_t *conn, Workspace *ws) { - Client *client; - - ignore_enter_notify_forall(conn, ws, true); - - /* Map all clients on the new workspace */ - FOR_TABLE(ws) - CIRCLEQ_FOREACH(client, &(ws->table[cols][rows]->clients), clients) - client_map(conn, client); - - /* Map all floating clients */ - if (!ws->floating_hidden) - TAILQ_FOREACH(client, &(ws->floating_clients), floating_clients) - client_map(conn, client); - - /* Map all stack windows, if any */ - struct Stack_Window *stack_win; - SLIST_FOREACH(stack_win, &stack_wins, stack_windows) - if (stack_win->container->workspace == ws && stack_win->rect.height > 0) - xcb_map_window(conn, stack_win->window); - - ignore_enter_notify_forall(conn, ws, false); -} - -/* - * Unmaps all clients (and stack windows) of the given workspace. - * - * This needs to be called separately when temporarily rendering - * a workspace which is not the active workspace to force - * reconfiguration of all clients, like in src/xinerama.c when - * re-assigning a workspace to another screen. - * - */ -void workspace_unmap_clients(xcb_connection_t *conn, Workspace *u_ws) { - Client *client; - struct Stack_Window *stack_win; - - /* Ignore notify events because they would cause focus to be changed */ - ignore_enter_notify_forall(conn, u_ws, true); - - /* Unmap all clients of the given workspace */ - int unmapped_clients = 0; - FOR_TABLE(u_ws) - CIRCLEQ_FOREACH(client, &(u_ws->table[cols][rows]->clients), clients) { - DLOG("unmapping normal client %p / %p / %p\n", client, client->frame, client->child); - client_unmap(conn, client); - unmapped_clients++; - } - - /* To find floating clients, we traverse the focus stack */ - SLIST_FOREACH(client, &(u_ws->focus_stack), focus_clients) { - if (!client_is_floating(client)) - continue; - - DLOG("unmapping floating client %p / %p / %p\n", client, client->frame, client->child); - - client_unmap(conn, client); - unmapped_clients++; - } - - /* If we did not unmap any clients, the workspace is empty and we can destroy it, at least - * if it is not the current workspace. */ - if (unmapped_clients == 0 && u_ws != c_ws) { - /* Re-assign the workspace of all dock clients which use this workspace */ - Client *dock; - DLOG("workspace %p is empty\n", u_ws); - SLIST_FOREACH(dock, &(u_ws->output->dock_clients), dock_clients) { - if (dock->workspace != u_ws) - continue; - - DLOG("Re-assigning dock client to c_ws (%p)\n", c_ws); - dock->workspace = c_ws; - } - u_ws->output = NULL; - } - - /* Unmap the stack windows on the given workspace, if any */ - SLIST_FOREACH(stack_win, &stack_wins, stack_windows) - if (stack_win->container->workspace == u_ws) - xcb_unmap_window(conn, stack_win->window); - - ignore_enter_notify_forall(conn, u_ws, false); -} #endif static bool get_urgency_flag(Con *con) { @@ -565,35 +478,3 @@ void workspace_update_urgent_flag(Con *ws) { if (old_flag != ws->urgent) ipc_send_event("workspace", I3_IPC_EVENT_WORKSPACE, "{\"change\":\"urgent\"}"); } - -#if 0 - -/* - * Returns the width of the workspace. - * - */ -int workspace_width(Workspace *ws) { - return ws->rect.width; -} - -/* - * Returns the effective height of the workspace (without the internal bar and - * without dock clients). - * - */ -int workspace_height(Workspace *ws) { - int height = ws->rect.height; - i3Font *font = load_font(global_conn, config.font); - - /* Reserve space for dock clients */ - Client *client; - SLIST_FOREACH(client, &(ws->output->dock_clients), dock_clients) - height -= client->desired_height; - - /* Space for the internal bar */ - if (!config.disable_workspace_bar) - height -= (font->height + 6); - - return height; -} -#endif