i3
|
#include "all.h"
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). | |
Con * | create_workspace_on_output (Output *output, Con *content) |
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) |
static void | _workspace_show (Con *workspace, bool changed_num_workspaces) |
void | workspace_show (Con *workspace) |
Switches to the given workspace. | |
void | workspace_show_by_name (const char *num) |
Looks up the workspace by name and switches to it. | |
Con * | workspace_next (void) |
Returns the next workspace. | |
Con * | workspace_prev (void) |
Returns the previous workspace. | |
Con * | workspace_next_on_output (void) |
Returns the next workspace on the same output. | |
Con * | workspace_prev_on_output (void) |
Returns the previous workspace on the same output. | |
void | workspace_back_and_forth (void) |
Focuses the previously focused 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). | |
Variables | |
static char * | previous_workspace_name = NULL |
Definition at line 231 of file workspace.c.
References Con::sticky_group, TAILQ_FOREACH, and Con::window.
Referenced by workspace_reassign_sticky().
static void _workspace_show | ( | Con * | workspace, |
bool | changed_num_workspaces | ||
) | [static] |
Definition at line 306 of file workspace.c.
References con_descend_focused(), con_focus(), con_get_output(), con_get_workspace(), DLOG, DONT_KILL_WINDOW, ewmh_update_current_desktop(), focused, FREE, Con::fullscreen_mode, ipc_send_event(), LOG, Con::name, Con::parent, previous_workspace_name, Con::rect, sstrdup(), TAILQ_EMPTY, TAILQ_FOREACH, tree_close(), workspace_is_visible(), workspace_reassign_sticky(), and x_set_warp_to().
Referenced by workspace_show(), and workspace_show_by_name().
Definition at line 97 of file workspace.c.
References bindings, Binding::command, con_attach(), con_new(), config, croot, Config::default_orientation, DLOG, FREE, Con::fullscreen_mode, GREP_FIRST, Rect::height, HORIZ, LOG, xoutput::name, Con::name, Workspace_Assignment::name, NO_ORIENTATION, Con::num, Con::orientation, Workspace_Assignment::output, output_get_content(), xoutput::rect, sasprintf(), TAILQ_FOREACH, Con::type, VERT, Rect::width, ws_assignments, and x_set_name().
Referenced by cmd_move_workspace_to_output(), and init_ws_for_output().
static bool get_urgency_flag | ( | Con * | con | ) | [static] |
Definition at line 659 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 735 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().
void workspace_back_and_forth | ( | void | ) |
Focuses the previously focused workspace.
Definition at line 650 of file workspace.c.
References DLOG, previous_workspace_name, and workspace_show_by_name().
Referenced by cmd_workspace_back_and_forth(), and cmd_workspace_name().
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, Con::name, Workspace_Assignment::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 cmd_move_con_to_workspace_name(), cmd_move_workspace_to_output(), manage_window(), scratchpad_move(), scratchpad_show(), workspace_show_by_name(), and yyparse().
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 218 of file workspace.c.
References con_get_fullscreen_con(), con_get_output(), LOG, and Workspace_Assignment::output.
Referenced by _tree_next(), _workspace_show(), cmd_focus_output(), cmd_move_con_to_output(), cmd_move_workspace_to_output(), con_move_to_workspace(), con_on_remove_child(), init_ws_for_output(), IPC_HANDLER(), and manage_window().
Con* workspace_next | ( | void | ) |
Returns the next workspace.
Definition at line 396 of file workspace.c.
References con_get_workspace(), croot, focused, Con::name, NODES_FOREACH, Con::num, Workspace_Assignment::output, output_get_content(), TAILQ_FOREACH, and TAILQ_NEXT.
Referenced by cmd_move_con_to_workspace(), and cmd_workspace().
Con* workspace_next_on_output | ( | void | ) |
Returns the next workspace on the same output.
Definition at line 538 of file workspace.c.
References con_get_output(), con_get_workspace(), focused, NODES_FOREACH, Con::num, Workspace_Assignment::output, output_get_content(), and TAILQ_NEXT.
Referenced by cmd_move_con_to_workspace(), and cmd_workspace().
Con* workspace_prev | ( | void | ) |
Returns the previous workspace.
Definition at line 466 of file workspace.c.
References con_get_workspace(), croot, focused, Con::name, NODES_FOREACH_REVERSE, Con::num, Workspace_Assignment::output, output_get_content(), TAILQ_FOREACH_REVERSE, and TAILQ_PREV.
Referenced by cmd_move_con_to_workspace(), and cmd_workspace().
Con* workspace_prev_on_output | ( | void | ) |
Returns the previous workspace on the same output.
Definition at line 593 of file workspace.c.
References con_get_output(), con_get_workspace(), DLOG, focused, Con::name, NODES_FOREACH_REVERSE, Con::num, Workspace_Assignment::output, output_get_content(), and TAILQ_PREV.
Referenced by cmd_move_con_to_workspace(), and cmd_workspace().
static void workspace_reassign_sticky | ( | Con * | con | ) | [static] |
Definition at line 268 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 | ( | Con * | ws | ) |
Switches to the given workspace.
Definition at line 377 of file workspace.c.
References _workspace_show().
Referenced by _tree_next(), check_crossing_screen_boundary(), cmd_focus(), cmd_focus_output(), cmd_move_workspace_to_output(), cmd_workspace(), cmd_workspace_number(), con_move_to_workspace(), handle_enter_notify(), handle_focus_in(), init_ws_for_output(), randr_query_outputs(), route_click(), and scratchpad_show().
void workspace_show_by_name | ( | const char * | num | ) |
Looks up the workspace by name and switches to it.
Definition at line 385 of file workspace.c.
References _workspace_show(), and workspace_get().
Referenced by cmd_workspace_name(), init_ws_for_output(), and workspace_back_and_forth().
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 677 of file workspace.c.
References DLOG, get_urgency_flag(), ipc_send_event(), and Con::urgent.
Referenced by con_focus(), and handle_hints().
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 692 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().
char* previous_workspace_name = NULL [static] |
Definition at line 15 of file workspace.c.
Referenced by _workspace_show(), and workspace_back_and_forth().