i3
|
Go to the source code of this file.
Defines | |
#define | _WORKSPACE_H |
Functions | |
Workspace * | workspace_get (int number) |
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). | |
void | workspace_set_name (Workspace *ws, const char *name) |
Sets the name (or just its number) for the given workspace. | |
bool | workspace_is_visible (Workspace *ws) |
Returns true if the workspace is currently visible. | |
void | workspace_show (xcb_connection_t *conn, int workspace) |
Switches to the given workspace. | |
void | workspace_assign_to (Workspace *ws, Output *screen, bool hide_it) |
Assigns the given workspace to the given screen by correctly updating its state and reconfiguring all the clients on this workspace. | |
void | workspace_initialize (Workspace *ws, Output *screen, bool recheck) |
Initializes the given workspace if it is not already initialized. | |
Workspace * | get_first_workspace_for_output (Output *screen) |
Gets the first unused workspace for the given screen, taking into account the preferred_screen setting of every workspace (workspace assignments). | |
void | workspace_unmap_clients (xcb_connection_t *conn, Workspace *u_ws) |
Unmaps all clients (and stack windows) of the given workspace. | |
void | workspace_map_clients (xcb_connection_t *conn, Workspace *ws) |
Maps all clients (and stack windows) of the given workspace. | |
void | workspace_update_urgent_flag (Workspace *ws) |
Goes through all clients on the given workspace and updates the workspace’s urgent flag accordingly. | |
int | workspace_width (Workspace *ws) |
int | workspace_height (Workspace *ws) |
#define _WORKSPACE_H |
Definition at line 17 of file workspace.h.
Gets the first unused workspace for the given screen, taking into account the preferred_screen setting of every workspace (workspace assignments).
Definition at line 300 of file workspace.c.
References DLOG, get_output_by_name(), Workspace::num, Workspace::output, Workspace::preferred_output, TAILQ_FOREACH, workspace_get(), workspace_initialize(), and workspaces.
Referenced by init_workspaces(), and initialize_xinerama().
Assigns the given workspace to the given screen by correctly updating its state and reconfiguring all the clients on this workspace.
This is called when initializing a screen and when re-assigning it to a different screen which just got available (if you configured it to be on screen 1 and you just plugged in screen 1).
Definition at line 222 of file workspace.c.
References c_ws, xoutput::current_workspace, DLOG, ewmh_update_workarea(), Client::force_reconfigure, global_conn, ipc_send_event(), Workspace::output, xoutput::rect, Workspace::rect, render_workspace(), SLIST_FOREACH, workspace_is_visible(), and workspace_unmap_clients().
Referenced by initialize_output(), randr_query_outputs(), and workspace_initialize().
Workspace* workspace_get | ( | int | number | ) |
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).
Definition at line 39 of file workspace.c.
References DLOG, ewmh_update_workarea(), expand_table_cols(), expand_table_rows(), ipc_send_event(), Workspace::num, scalloc(), TAILQ_FOREACH, TAILQ_INIT, TAILQ_INSERT_TAIL, TAILQ_LAST, workspace_set_name(), and workspaces.
Referenced by get_first_workspace_for_output(), move_current_window_to_workspace(), move_floating_window_to_workspace(), reparent_window(), workspace_show(), and yyparse().
int workspace_height | ( | Workspace * | ws | ) |
Definition at line 462 of file workspace.c.
References config, Client::desired_height, Config::disable_workspace_bar, Config::font, global_conn, Font::height, Rect::height, height, load_font(), Workspace::output, Workspace::rect, and SLIST_FOREACH.
Referenced by get_unoccupied_y(), render_workspace(), and resize_container().
Initializes the given workspace if it is not already initialized.
The given screen is to be understood as a fallback, if the workspace itself either was not assigned to a particular screen or cannot be placed there because the screen is not attached at the moment.
Definition at line 270 of file workspace.c.
References DLOG, get_output_by_name(), Workspace::output, Workspace::preferred_output, and workspace_assign_to().
Referenced by get_first_workspace_for_output(), move_current_window_to_workspace(), move_floating_window_to_workspace(), reparent_window(), and workspace_show().
bool workspace_is_visible | ( | Workspace * | 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 105 of file workspace.c.
References xoutput::current_workspace, and Workspace::output.
Referenced by handle_hints(), handle_normal_hints(), handle_unmap_notify_event(), handle_windowname_change(), handle_windowname_change_legacy(), move_current_window_to_workspace(), move_floating_window_to_workspace(), reparent_window(), and workspace_assign_to().
void workspace_map_clients | ( | xcb_connection_t * | conn, |
Workspace * | ws | ||
) |
Maps all clients (and stack windows) of the given workspace.
Definition at line 341 of file workspace.c.
References CIRCLEQ_FOREACH, client_map(), Stack_Window::container, Workspace::floating_hidden, FOR_TABLE, Rect::height, ignore_enter_notify_forall(), Stack_Window::rect, SLIST_FOREACH, stack_wins, Workspace::table, TAILQ_FOREACH, Stack_Window::window, and Container::workspace.
Referenced by initialize_output(), and workspace_show().
void workspace_set_name | ( | Workspace * | ws, |
const char * | name | ||
) |
Sets the name (or just its number) for the given workspace.
This has to be called for every workspace as the rendering function (render_internal_bar) relies on workspace->name and workspace->name_len being ready-to-use.
Definition at line 78 of file workspace.c.
References config, convert_utf8_to_ucs2(), Config::font, FREE, global_conn, Workspace::name, Workspace::name_len, Workspace::num, predict_text_width(), Workspace::text_width, and Workspace::utf8_name.
Referenced by init_table(), load_configuration(), workspace_get(), and yyparse().
void workspace_show | ( | xcb_connection_t * | conn, |
int | workspace | ||
) |
Switches to the given workspace.
Definition at line 113 of file workspace.c.
References c_ws, client_enter_fullscreen(), client_warp_pointer_into(), CUR_CELL, current_col, Workspace::current_col, current_row, Workspace::current_row, xoutput::current_workspace, DLOG, Client::dock, Workspace::fullscreen_client, Rect::height, ipc_send_event(), Workspace::num, Workspace::output, xoutput::rect, redecorate_window(), render_layout(), root, set_focus(), SLIST_END, SLIST_FIRST, Rect::width, Client::workspace, workspace_get(), workspace_initialize(), workspace_map_clients(), workspace_unmap_clients(), Rect::x, and Rect::y.
Referenced by button_press_bar(), focus_thing(), jump_to_container(), jump_to_mark(), jump_to_window(), next_previous_workspace(), and parse_command().
void workspace_unmap_clients | ( | xcb_connection_t * | conn, |
Workspace * | u_ws | ||
) |
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.
Definition at line 374 of file workspace.c.
References c_ws, Client::child, CIRCLEQ_FOREACH, client_is_floating(), client_unmap(), Stack_Window::container, DLOG, FOR_TABLE, Client::frame, ignore_enter_notify_forall(), Workspace::output, SLIST_FOREACH, stack_wins, Workspace::table, Stack_Window::window, Container::workspace, and Client::workspace.
Referenced by workspace_assign_to(), and workspace_show().
void workspace_update_urgent_flag | ( | Workspace * | ws | ) |
Goes through all clients on the given workspace and updates the workspace’s urgent flag accordingly.
Definition at line 430 of file workspace.c.
References ipc_send_event(), SLIST_FOREACH, Client::urgent, and Workspace::urgent.
Referenced by handle_hints(), handle_unmap_notify_event(), and set_focus().
int workspace_width | ( | Workspace * | ws | ) |
Definition at line 453 of file workspace.c.
References Workspace::rect, and Rect::width.