i3
Functions
include/workspace.h File Reference
#include "data.h"
#include "tree.h"
#include "randr.h"
Include dependency graph for workspace.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

Conworkspace_get (const char *num, bool *created)
 Returns a pointer to the workspace with the given number (starting at 0), creating the workspace if necessary (by allocating the necessary amount of memory and initializing the data structures correctly).
bool workspace_is_visible (Con *ws)
 Returns true if the workspace is currently visible.
void workspace_show (Con *ws)
 Switches to the given workspace.
void workspace_show_by_name (const char *num)
 Looks up the workspace by name and switches to it.
Conworkspace_next ()
 Returns the next workspace.
Conworkspace_prev ()
 Returns the previous workspace.
void workspace_back_and_forth ()
 Focuses the previously focused workspace.
void workspace_update_urgent_flag (Con *ws)
 Goes through all clients on the given workspace and updates the workspace’s urgent flag accordingly.
void ws_force_orientation (Con *ws, orientation_t orientation)
 'Forces' workspace orientation by moving all cons into a new split-con with the same orientation as the workspace and then changing the workspace orientation.
Conworkspace_attach_to (Con *ws)
 Called when a new con (with a window, not an empty or split con) should be attached to the workspace (for example when managing a new window or when moving an existing window to the workspace level).

Function Documentation

Called when a new con (with a window, not an empty or split con) should be attached to the workspace (for example when managing a new window or when moving an existing window to the workspace level).

Depending on the workspace_layout setting, this function either returns the workspace itself (default layout) or creates a new stacked/tabbed con and returns that.

Definition at line 473 of file workspace.c.

References con_attach(), con_new(), config, Config::default_layout, Config::default_orientation, DLOG, Rect::height, HORIZ, Con::layout, Con::name, NO_ORIENTATION, Con::rect, VERT, and Rect::width.

Referenced by con_attach(), and insert_con_into().

Here is the call graph for this function:

Focuses the previously focused workspace.

Definition at line 388 of file workspace.c.

References DLOG, previous_workspace_name, and workspace_show_by_name().

Here is the call graph for this function:

Con* workspace_get ( const char *  num,
bool *  created 
)

Returns a pointer to the workspace with the given number (starting at 0), creating the workspace if necessary (by allocating the necessary amount of memory and initializing the data structures correctly).

If created is not NULL, *created will be set to whether or not the workspace has just been created.

Definition at line 23 of file workspace.c.

References con_attach(), con_get_output(), con_new(), config, croot, Config::default_orientation, DLOG, focused, FREE, GREP_FIRST, Rect::height, HORIZ, ipc_send_event(), LOG, Workspace_Assignment::name, Con::name, NO_ORIENTATION, Con::num, Con::orientation, Workspace_Assignment::output, output_get_content(), Con::rect, sasprintf(), sstrdup(), TAILQ_FOREACH, Con::type, VERT, Rect::width, ws_assignments, and x_set_name().

Referenced by manage_window(), and workspace_show_by_name().

Here is the call graph for this function:

bool workspace_is_visible ( Con ws)

Returns true if the workspace is currently visible.

Especially important for multi-monitor environments, as they can have multiple currenlty active workspaces.

Definition at line 97 of file workspace.c.

References con_get_fullscreen_con(), con_get_output(), LOG, and Workspace_Assignment::output.

Referenced by _tree_next(), _workspace_show(), con_move_to_workspace(), con_on_remove_child(), init_ws_for_output(), IPC_HANDLER(), and manage_window().

Here is the call graph for this function:

Returns the next workspace.

Definition at line 271 of file workspace.c.

References con_get_workspace(), croot, focused, NODES_FOREACH, Con::num, Workspace_Assignment::output, output_get_content(), TAILQ_FOREACH, and TAILQ_NEXT.

Here is the call graph for this function:

Returns the previous workspace.

Definition at line 329 of file workspace.c.

References con_get_workspace(), croot, focused, NODES_FOREACH_REVERSE, Con::num, Workspace_Assignment::output, output_get_content(), TAILQ_FOREACH_REVERSE, and TAILQ_PREV.

Here is the call graph for this function:

void workspace_show ( Con ws)

Switches to the given workspace.

Definition at line 252 of file workspace.c.

References _workspace_show().

Referenced by _tree_next(), check_crossing_screen_boundary(), con_move_to_workspace(), handle_enter_notify(), handle_focus_in(), init_ws_for_output(), and randr_query_outputs().

Here is the call graph for this function:

void workspace_show_by_name ( const char *  num)

Looks up the workspace by name and switches to it.

Definition at line 260 of file workspace.c.

References _workspace_show(), and workspace_get().

Referenced by init_ws_for_output(), and workspace_back_and_forth().

Here is the call graph for this function:

Goes through all clients on the given workspace and updates the workspace’s urgent flag accordingly.

Definition at line 415 of file workspace.c.

References DLOG, get_urgency_flag(), ipc_send_event(), and Con::urgent.

Referenced by con_focus(), and handle_hints().

Here is the call graph for this function:

void ws_force_orientation ( Con ws,
orientation_t  orientation 
)

'Forces' workspace orientation by moving all cons into a new split-con with the same orientation as the workspace and then changing the workspace orientation.

Definition at line 430 of file workspace.c.

References con_attach(), con_detach(), con_fix_percent(), con_focus(), con_new(), DLOG, Con::layout, Con::orientation, Con::parent, TAILQ_EMPTY, and TAILQ_FIRST.

Referenced by tree_move().

Here is the call graph for this function: