i3
|
Go to the source code of this file.
Functions | |
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). | |
bool | workspace_is_visible (Con *ws) |
Returns true if the workspace is currently visible. | |
Con * | _get_sticky (Con *con, const char *sticky_group, Con *exclude) |
static void | workspace_reassign_sticky (Con *con) |
void | workspace_show (const char *num) |
Switches to the given workspace. | |
void | workspace_next () |
Focuses the next workspace. | |
void | workspace_prev () |
Focuses the previous workspace. | |
static bool | get_urgency_flag (Con *con) |
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. | |
Con * | workspace_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). |
Definition at line 107 of file workspace.c.
References Con::sticky_group, TAILQ_FOREACH, and Con::window.
Referenced by workspace_reassign_sticky().
static bool get_urgency_flag | ( | Con * | con | ) | [static] |
Definition at line 260 of file workspace.c.
References TAILQ_FOREACH, and Con::urgent.
Referenced by workspace_update_urgent_flag().
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 336 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().
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 20 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, Con::name, Workspace_Assignment::name, NO_ORIENTATION, Con::num, Con::orientation, Workspace_Assignment::output, output_get_content(), Con::rect, sstrdup(), TAILQ_FOREACH, Con::type, VERT, Rect::width, ws_assignments, and x_set_name().
Referenced by manage_window(), and workspace_show().
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 94 of file workspace.c.
References con_get_fullscreen_con(), con_get_output(), LOG, and Workspace_Assignment::output.
Referenced by con_move_to_workspace(), handle_hints(), handle_unmap_notify_event(), init_ws_for_output(), IPC_HANDLER(), and workspace_show().
void workspace_next | ( | ) |
Focuses the next workspace.
Definition at line 238 of file workspace.c.
References con_get_workspace(), focused, Con::name, Con::parent, TAILQ_FIRST, TAILQ_NEXT, and workspace_show().
void workspace_prev | ( | ) |
Focuses the previous workspace.
Definition at line 251 of file workspace.c.
References con_get_workspace(), focused, Con::name, Con::parent, TAILQ_LAST, TAILQ_PREV, and workspace_show().
static void workspace_reassign_sticky | ( | Con * | con | ) | [static] |
Definition at line 144 of file workspace.c.
References _get_sticky(), con_get_output(), LOG, Con::mapped, Con::name, Workspace_Assignment::output, Con::sticky_group, TAILQ_FOREACH, Con::window, x_move_win(), and x_reparent_child().
Referenced by workspace_show().
void workspace_show | ( | const char * | num | ) |
Switches to the given workspace.
Definition at line 185 of file workspace.c.
References con_descend_focused(), con_focus(), con_get_workspace(), DLOG, DONT_KILL_WINDOW, ewmh_update_current_desktop(), ewmh_update_workarea(), focused, Con::fullscreen_mode, ipc_send_event(), LOG, Con::name, Con::parent, TAILQ_EMPTY, TAILQ_FOREACH, tree_close(), workspace_get(), workspace_is_visible(), and workspace_reassign_sticky().
Referenced by init_ws_for_output(), workspace_next(), and workspace_prev().
void workspace_update_urgent_flag | ( | Con * | ws | ) |
Goes through all clients on the given workspace and updates the workspace’s urgent flag accordingly.
Definition at line 278 of file workspace.c.
References DLOG, get_urgency_flag(), ipc_send_event(), and Con::urgent.
Referenced by con_focus(), handle_hints(), and handle_unmap_notify_event().
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 293 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().