|
i3
|

Go to the source code of this file.
Data Structures | |
| struct | bfs_entry |
Macros | |
| #define | I3__FILE__ "con.c" |
Functions | |
| static void | con_on_remove_child (Con *con) |
| void | con_force_split_parents_redraw (Con *con) |
| force parent split containers to be redrawn More... | |
| Con * | con_new_skeleton (Con *parent, i3Window *window) |
| Create a new container (and attach it to the given parent, if not NULL). More... | |
| Con * | con_new (Con *parent, i3Window *window) |
| static void | _con_attach (Con *con, Con *parent, Con *previous, bool ignore_focus) |
| void | con_attach (Con *con, Con *parent, bool ignore_focus) |
| Attaches the given container to the given parent. More... | |
| void | con_detach (Con *con) |
| Detaches the given container from its current parent. More... | |
| void | con_focus (Con *con) |
| Sets input focus to the given container. More... | |
| void | con_close (Con *con, kill_window_t kill_window) |
| Closes the given container. More... | |
| bool | con_is_leaf (Con *con) |
| Returns true when this node is a leaf node (has no children) More... | |
| bool | con_has_managed_window (Con *con) |
| Returns true when this con is a leaf node with a managed X11 window (e.g., excluding dock containers) More... | |
| bool | con_has_children (Con *con) |
| Returns true if this node has regular or floating children. More... | |
| bool | con_is_split (Con *con) |
| Returns true if a container should be considered split. More... | |
| bool | con_is_hidden (Con *con) |
| This will only return true for containers which have some parent with a tabbed / stacked parent of which they are not the currently focused child. More... | |
| bool | con_is_sticky (Con *con) |
| Returns whether the container or any of its children is sticky. More... | |
| bool | con_accepts_window (Con *con) |
| Returns true if this node accepts a window (if the node swallows windows, it might already have swallowed enough and cannot hold any more). More... | |
| Con * | con_get_output (Con *con) |
| Gets the output container (first container with CT_OUTPUT in hierarchy) this node is on. More... | |
| Con * | con_get_workspace (Con *con) |
| Gets the workspace container this node is on. More... | |
| Con * | con_parent_with_orientation (Con *con, orientation_t orientation) |
| Searches parenst of the given 'con' until it reaches one with the specified 'orientation'. More... | |
| Con * | con_get_fullscreen_con (Con *con, fullscreen_mode_t fullscreen_mode) |
| Returns the first fullscreen node below this node. More... | |
| bool | con_is_internal (Con *con) |
| Returns true if the container is internal, such as __i3_scratch. More... | |
| bool | con_is_floating (Con *con) |
| Returns true if the node is floating. More... | |
| bool | con_is_docked (Con *con) |
| Returns true if the container is a docked container. More... | |
| Con * | con_inside_floating (Con *con) |
| Checks if the given container is either floating or inside some floating container. More... | |
| bool | con_inside_focused (Con *con) |
| Checks if the given container is inside a focused container. More... | |
| Con * | con_by_window_id (xcb_window_t window) |
| Returns the container with the given client window ID or NULL if no such container exists. More... | |
| Con * | con_by_frame_id (xcb_window_t frame) |
| Returns the container with the given frame ID or NULL if no such container exists. More... | |
| Con * | con_by_mark (const char *mark) |
| Returns the container with the given mark or NULL if no such container exists. More... | |
| bool | con_has_mark (Con *con, const char *mark) |
| Returns true if and only if the given containers holds the mark. More... | |
| void | con_mark_toggle (Con *con, const char *mark, mark_mode_t mode) |
| Toggles the mark on a container. More... | |
| void | con_mark (Con *con, const char *mark, mark_mode_t mode) |
| Assigns a mark to the container. More... | |
| void | con_unmark (Con *con, const char *name) |
| Con * | con_for_window (Con *con, i3Window *window, Match **store_match) |
| Returns the first container below 'con' which wants to swallow this window TODO: priority. More... | |
| int | con_num_children (Con *con) |
| Returns the number of children of this container. More... | |
| void | con_fix_percent (Con *con) |
| Updates the percent attribute of the children of the given container. More... | |
| void | con_toggle_fullscreen (Con *con, int fullscreen_mode) |
| Toggles fullscreen mode for the given container. More... | |
| static void | con_set_fullscreen_mode (Con *con, fullscreen_mode_t fullscreen_mode) |
| void | con_enable_fullscreen (Con *con, fullscreen_mode_t fullscreen_mode) |
| Enables fullscreen mode for the given container, if necessary. More... | |
| void | con_disable_fullscreen (Con *con) |
| Disables fullscreen mode for the given container, if necessary. More... | |
| static bool | _con_move_to_con (Con *con, Con *target, bool behind_focused, bool fix_coordinates, bool dont_warp, bool ignore_focus) |
| bool | con_move_to_mark (Con *con, const char *mark) |
| Moves the given container to the given mark. More... | |
| void | con_move_to_workspace (Con *con, Con *workspace, bool fix_coordinates, bool dont_warp, bool ignore_focus) |
| Moves the given container to the currently focused container on the given workspace. More... | |
| orientation_t | con_orientation (Con *con) |
| Returns the orientation of the given container (for stacked containers, vertical orientation is used regardless of the actual orientation of the container). More... | |
| Con * | con_next_focused (Con *con) |
| Returns the container which will be focused next when the given container is not available anymore. More... | |
| Con * | con_get_next (Con *con, char way, orientation_t orientation) |
| Get the next/previous container in the specified orientation. More... | |
| Con * | con_descend_focused (Con *con) |
| Returns the focused con inside this client, descending the tree as far as possible. More... | |
| Con * | con_descend_tiling_focused (Con *con) |
| Returns the focused con inside this client, descending the tree as far as possible. More... | |
| Con * | con_descend_direction (Con *con, direction_t direction) |
| Rect | con_border_style_rect (Con *con) |
| Returns a "relative" Rect which contains the amount of pixels that need to be added to the original Rect to get the final position (obviously the amount of pixels for normal, 1pixel and borderless are different). More... | |
| adjacent_t | con_adjacent_borders (Con *con) |
| Returns adjacent borders of the window. More... | |
| int | con_border_style (Con *con) |
| Use this function to get a container’s border style. More... | |
| void | con_set_border_style (Con *con, int border_style, int border_width) |
| Sets the given border style on con, correctly keeping the position/size of a floating window. More... | |
| void | con_set_layout (Con *con, layout_t layout) |
| This function changes the layout of a given container. More... | |
| void | con_toggle_layout (Con *con, const char *toggle_mode) |
| This function toggles the layout of a given container. More... | |
| Rect | con_minimum_size (Con *con) |
| Determines the minimum size of the given con by looking at its children (for split/stacked/tabbed cons). More... | |
| bool | con_fullscreen_permits_focusing (Con *con) |
| Returns true if changing the focus to con would be allowed considering the fullscreen focus constraints. More... | |
| bool | con_has_urgent_child (Con *con) |
| Checks if the given container has an urgent child. More... | |
| void | con_update_parents_urgency (Con *con) |
| Make all parent containers urgent if con is urgent or clear the urgent flag of all parent containers if there are no more urgent children left. More... | |
| void | con_set_urgency (Con *con, bool urgent) |
| Set urgency flag to the container, all the parent containers and the workspace. More... | |
| char * | con_get_tree_representation (Con *con) |
| Create a string representing the subtree under con. More... | |
| i3String * | con_parse_title_format (Con *con) |
| Returns the window title considering the current title format. More... | |
Definition at line 75 of file con.c.
References con_force_split_parents_redraw(), DLOG, focused, L_DEFAULT, Con::num, Con::parent, TAILQ_EMPTY, TAILQ_END, TAILQ_FIRST, TAILQ_FOREACH, TAILQ_INSERT_AFTER, TAILQ_INSERT_BEFORE, TAILQ_INSERT_HEAD, TAILQ_INSERT_TAIL, TAILQ_NEXT, Con::type, Con::window, workspace_attach_to(), and Con::workspace_layout.
Referenced by _con_move_to_con(), and con_attach().

|
static |
Definition at line 897 of file con.c.
References _con_attach(), CALL, CF_NONE, CF_OUTPUT, con_descend_focused(), con_detach(), con_fix_percent(), con_focus(), con_fullscreen_permits_focusing(), con_get_fullscreen_con(), con_get_output(), con_get_workspace(), con_inside_floating(), con_is_floating(), con_is_internal(), con_is_leaf(), con_move_to_workspace(), con_next_focused(), con_set_urgency(), con_toggle_fullscreen(), conn, DLOG, ELOG, ewmh_update_wm_desktop(), floating_fix_coordinates(), focused, Con::fullscreen_mode, Window::id, ipc_send_window_event(), LOG, Con::name, output_get_content(), Con::parent, Con::percent, Con::rect, startup_sequence_delete(), startup_sequence_get(), TAILQ_EMPTY, TAILQ_FIRST, TAILQ_FOREACH, Con::type, Con::urgent, Con::window, workspace_encapsulate(), workspace_is_visible(), workspace_show(), workspace_update_urgent_flag(), and x_set_warp_to().
Referenced by con_move_to_mark(), and con_move_to_workspace().

| bool con_accepts_window | ( | Con * | con | ) |
Returns true if this node accepts a window (if the node swallows windows, it might already have swallowed enough and cannot hold any more).
Definition at line 340 of file con.c.
References con_is_split(), DLOG, Con::type, and Con::window.
Referenced by cmd_append_layout(), and manage_window().

| adjacent_t con_adjacent_borders | ( | Con * | con | ) |
Returns adjacent borders of the window.
We need this if hide_edge_borders is enabled.
Definition at line 1458 of file con.c.
References ADJ_LEFT_SCREEN_EDGE, ADJ_LOWER_SCREEN_EDGE, ADJ_NONE, ADJ_RIGHT_SCREEN_EDGE, ADJ_UPPER_SCREEN_EDGE, con_get_workspace(), con_is_floating(), Rect::height, Con::rect, Rect::width, Startup_Sequence::workspace, Rect::x, and Rect::y.
Referenced by con_border_style_rect(), x_draw_decoration(), and x_draw_title_border().

Attaches the given container to the given parent.
This happens when moving a container or when inserting a new container at a specific place in the tree.
ignore_focus is to just insert the Con at the end (useful when creating a new split container around some containers, that is, detaching and attaching them in order without wanting to mess with the focus in between).
Definition at line 174 of file con.c.
References _con_attach().
Referenced by _create___i3(), cmd_rename_workspace(), con_new_skeleton(), con_set_layout(), create_workspace_on_output(), floating_disable(), handle_configure_request(), init_ws_for_output(), insert_con_into(), json_end_map(), output_init_con(), randr_query_outputs(), tree_split(), workspace_attach_to(), workspace_encapsulate(), workspace_get(), workspace_move_to_output(), and ws_force_orientation().

| int con_border_style | ( | Con * | con | ) |
Use this function to get a container’s border style.
This is important because when inside a stack, the border style is always BS_NORMAL. For tabbed mode, the same applies, with one exception: when the container is borderless and the only element in the tabbed container, the border is not rendered.
For children of a CT_DOCKAREA, the border style is always none.
Definition at line 1487 of file con.c.
References Con::border_style, BS_NONE, BS_NORMAL, CF_OUTPUT, con_get_fullscreen_con(), con_num_children(), DLOG, L_STACKED, L_TABBED, Con::layout, Con::parent, and Con::type.
Referenced by con_border_style_rect(), floating_check_size(), floating_enable(), and x_draw_decoration().

Returns a "relative" Rect which contains the amount of pixels that need to be added to the original Rect to get the final position (obviously the amount of pixels for normal, 1pixel and borderless are different).
Definition at line 1413 of file con.c.
References ADJ_LEFT_SCREEN_EDGE, ADJ_LOWER_SCREEN_EDGE, ADJ_NONE, ADJ_RIGHT_SCREEN_EDGE, ADJ_UPPER_SCREEN_EDGE, BS_NONE, BS_NORMAL, con_adjacent_borders(), con_border_style(), con_is_floating(), config, Con::current_border_width, Config::default_border_width, Config::default_floating_border_width, DLOG, Rect::height, Config::hide_edge_borders, Rect::width, Rect::x, and Rect::y.
Referenced by con_set_border_style(), floating_check_size(), floating_enable(), handle_configure_request(), render_con(), tiling_resize(), x_draw_decoration(), and x_draw_decoration_after_title().

| Con* con_by_frame_id | ( | xcb_window_t | frame | ) |
Returns the container with the given frame ID or NULL if no such container exists.
Definition at line 544 of file con.c.
References all_cons, bfs_entry::con, Con::frame, surface_t::id, and TAILQ_FOREACH.
Referenced by handle_button_press(), handle_enter_notify(), handle_expose_event(), handle_motion_notify(), and handle_unmap_notify_event().
| Con* con_by_mark | ( | const char * | mark | ) |
Returns the container with the given mark or NULL if no such container exists.
Definition at line 557 of file con.c.
References all_cons, bfs_entry::con, con_has_mark(), and TAILQ_FOREACH.
Referenced by con_move_to_mark(), and con_unmark().

| Con* con_by_window_id | ( | xcb_window_t | window | ) |
Returns the container with the given client window ID or NULL if no such container exists.
Definition at line 531 of file con.c.
References all_cons, bfs_entry::con, Window::id, TAILQ_FOREACH, and Con::window.
Referenced by floating_enable(), handle_button_press(), handle_class_change(), handle_client_message(), handle_clientleader_change(), handle_configure_request(), handle_enter_notify(), handle_focus_in(), handle_hints(), handle_normal_hints(), handle_strut_partial_change(), handle_transient_for(), handle_unmap_notify_event(), handle_window_type(), handle_windowname_change(), handle_windowname_change_legacy(), handle_windowrole_change(), manage_window(), match_matches_window(), render_root(), startup_sequence_get(), window_update_name(), window_update_name_legacy(), and xcb_drag_check_cb().
| void con_close | ( | Con * | con, |
| kill_window_t | kill_window | ||
| ) |
Closes the given container.
Definition at line 227 of file con.c.
References DLOG, focused, TAILQ_FIRST, TAILQ_NEXT, tree_close_internal(), and Con::type.
Referenced by cmd_kill().

| Con* con_descend_direction | ( | Con * | con, |
| direction_t | direction | ||
| ) |
Definition at line 1347 of file con.c.
References bfs_entry::con, con_descend_direction(), con_orientation(), D_DOWN, D_LEFT, D_RIGHT, D_UP, DLOG, focused, HORIZ, TAILQ_FIRST, TAILQ_FOREACH, TAILQ_LAST, Con::type, and VERT.
Referenced by _tree_next(), con_descend_direction(), and tree_move().

Returns the focused con inside this client, descending the tree as far as possible.
This comes in handy when attaching a con to a workspace at the currently focused position, for example.
Definition at line 1306 of file con.c.
References bfs_entry::con, focused, TAILQ_EMPTY, and TAILQ_FIRST.
Referenced by _con_move_to_con(), _tree_next(), _workspace_show(), check_crossing_screen_boundary(), cmd_focus_window_mode(), cmd_resize_floating(), con_move_to_workspace(), con_next_focused(), floating_check_size(), floating_maybe_reassign_ws(), floating_resize(), handle_enter_notify(), main(), randr_query_outputs(), render_root(), and scratchpad_show().
Returns the focused con inside this client, descending the tree as far as possible.
This comes in handy when attaching a con to a workspace at the currently focused position, for example.
Works like con_descend_focused but considers only tiling cons.
Definition at line 1321 of file con.c.
References bfs_entry::con, focused, TAILQ_FOREACH, and Con::type.
Referenced by floating_disable(), manage_window(), scratchpad_show(), and tree_open_con().
| void con_detach | ( | Con * | con | ) |
Detaches the given container from its current parent.
Definition at line 182 of file con.c.
References con_force_split_parents_redraw(), focused, Con::parent, TAILQ_REMOVE, and Con::type.
Referenced by _con_move_to_con(), attach_to_workspace(), cmd_rename_workspace(), con_set_layout(), handle_configure_request(), handle_strut_partial_change(), init_ws_for_output(), insert_con_into(), randr_query_outputs(), tree_flatten(), workspace_encapsulate(), workspace_move_to_output(), and ws_force_orientation().

| void con_disable_fullscreen | ( | Con * | con | ) |
Disables fullscreen mode for the given container, if necessary.
Definition at line 881 of file con.c.
References CF_NONE, con_set_fullscreen_mode(), DLOG, Con::fullscreen_mode, Con::name, and Con::type.
Referenced by cmd_fullscreen(), con_enable_fullscreen(), and con_toggle_fullscreen().

| void con_enable_fullscreen | ( | Con * | con, |
| fullscreen_mode_t | fullscreen_mode | ||
| ) |
Enables fullscreen mode for the given container, if necessary.
Definition at line 835 of file con.c.
References CF_GLOBAL, CF_OUTPUT, con_disable_fullscreen(), con_focus(), con_get_fullscreen_con(), con_get_workspace(), con_set_fullscreen_mode(), croot, DLOG, focused, Con::fullscreen_mode, Con::name, Con::type, and workspace_show().
Referenced by cmd_fullscreen(), and con_toggle_fullscreen().

| void con_fix_percent | ( | Con * | con | ) |
Updates the percent attribute of the children of the given container.
This function needs to be called when a window is added or removed from a container.
Definition at line 736 of file con.c.
References con_num_children(), Con::percent, and TAILQ_FOREACH.
Referenced by _con_move_to_con(), _create___i3(), attach_to_workspace(), floating_disable(), floating_enable(), insert_con_into(), json_end_array(), output_init_con(), resize_graphical_handler(), tree_append_json(), tree_open_con(), workspace_attach_to(), and ws_force_orientation().

| void con_focus | ( | Con * | con | ) |
Sets input focus to the given container.
Will be updated in X11 in the next run of x_push_changes().
Definition at line 198 of file con.c.
References con_focus(), con_get_workspace(), con_is_leaf(), con_set_urgency(), con_update_parents_urgency(), DLOG, focused, ipc_send_window_event(), Con::parent, TAILQ_INSERT_HEAD, TAILQ_REMOVE, Con::urgent, and workspace_update_urgent_flag().
Referenced by _con_move_to_con(), _tree_next(), _workspace_show(), check_crossing_screen_boundary(), cmd_focus(), cmd_focus_window_mode(), cmd_move_direction(), cmd_open(), cmd_rename_workspace(), con_enable_fullscreen(), con_focus(), con_set_layout(), floating_disable(), floating_enable(), floating_maybe_reassign_ws(), handle_client_message(), handle_enter_notify(), handle_focus_in(), handle_motion_notify(), init_ws_for_output(), level_down(), level_up(), main(), manage_window(), move_to_output_directed(), randr_query_outputs(), route_click(), scratchpad_show(), tree_append_json(), tree_move(), and ws_force_orientation().

Returns the first container below 'con' which wants to swallow this window TODO: priority.
Definition at line 681 of file con.c.
References con_for_window(), match_matches_window(), and TAILQ_FOREACH.
Referenced by con_for_window(), handle_configure_request(), handle_strut_partial_change(), manage_window(), and randr_query_outputs().

| void con_force_split_parents_redraw | ( | Con * | con | ) |
force parent split containers to be redrawn
Definition at line 23 of file con.c.
References con_is_leaf(), Con::deco_render_params, FREE, Con::parent, and Con::type.
Referenced by _con_attach(), con_detach(), con_on_remove_child(), con_set_layout(), and tree_split().

| bool con_fullscreen_permits_focusing | ( | Con * | con | ) |
Returns true if changing the focus to con would be allowed considering the fullscreen focus constraints.
Specifically, if a fullscreen container or any of its descendants is focused, this function returns true if and only if focusing con would mean that focus would still be visible on screen, i.e., the newly focused container would not be obscured by a fullscreen container.
In the simplest case, if a fullscreen container or any of its descendants is fullscreen, this functions returns true if con is the fullscreen container itself or any of its descendants, as this means focus wouldn't escape the boundaries of the fullscreen container.
In case the fullscreen container is of type CF_OUTPUT, this function returns true if con is on a different workspace, as focus wouldn't be obscured by the fullscreen container that is constrained to a different workspace.
Note that this same logic can be applied to moving containers. If a container can be focused under the fullscreen focus constraints, it can also become a parent or sibling to the currently focused container.
Definition at line 1818 of file con.c.
References CF_NONE, CF_OUTPUT, con_get_workspace(), focused, Con::fullscreen_mode, Con::parent, and Con::type.
Referenced by _con_move_to_con(), _tree_next(), cmd_focus(), cmd_focus_level(), and tree_move().

| Con* con_get_fullscreen_con | ( | Con * | con, |
| fullscreen_mode_t | fullscreen_mode | ||
| ) |
Returns the first fullscreen node below this node.
Definition at line 421 of file con.c.
References bfs_entry::con, Con::fullscreen_mode, smalloc(), TAILQ_EMPTY, TAILQ_FIRST, TAILQ_FOREACH, TAILQ_HEAD, TAILQ_HEAD_INITIALIZER, TAILQ_INSERT_TAIL, and TAILQ_REMOVE.
Referenced by _con_move_to_con(), _tree_next(), cmd_workspace(), cmd_workspace_back_and_forth(), cmd_workspace_name(), cmd_workspace_number(), con_border_style(), con_enable_fullscreen(), handle_configure_request(), IPC_HANDLER(), manage_window(), render_con(), render_output(), render_root(), route_click(), and workspace_is_visible().

| Con* con_get_next | ( | Con * | con, |
| char | way, | ||
| orientation_t | orientation | ||
| ) |
Get the next/previous container in the specified orientation.
This may travel up until it finds a container with suitable orientation.
Definition at line 1269 of file con.c.
References bfs_entry::con, con_orientation(), DLOG, LOG, Con::parent, TAILQ_END, TAILQ_NEXT, TAILQ_PREV, and Con::type.

Gets the output container (first container with CT_OUTPUT in hierarchy) this node is on.
Definition at line 359 of file con.c.
References Con::parent, and Con::type.
Referenced by _con_move_to_con(), _workspace_apply_default_orientation(), _workspace_show(), cmd_append_layout(), floating_enable(), floating_maybe_reassign_ws(), get_output_of_con(), handle_configure_request(), handle_strut_partial_change(), init_ws_for_output(), manage_window(), move_to_output_directed(), resize_graphical_handler(), route_click(), scratchpad_fix_resolution(), scratchpad_show(), workspace_get(), workspace_is_visible(), workspace_move_to_output(), workspace_next_on_output(), workspace_prev_on_output(), and workspace_reassign_sticky().
| char* con_get_tree_representation | ( | Con * | con | ) |
Create a string representing the subtree under con.
Definition at line 1948 of file con.c.
References Window::class_instance, con_get_tree_representation(), con_is_leaf(), ELOG, L_DEFAULT, L_SPLITH, L_SPLITV, L_STACKED, L_TABBED, Con::layout, sasprintf(), sstrdup(), TAILQ_FIRST, TAILQ_FOREACH, and Con::window.
Referenced by con_get_tree_representation(), con_parse_title_format(), and x_draw_decoration().

Gets the workspace container this node is on.
Definition at line 373 of file con.c.
References Con::parent, and Con::type.
Referenced by _con_move_to_con(), _tree_next(), _workspace_show(), check_crossing_screen_boundary(), cmd_focus(), cmd_focus_window_mode(), cmd_move_con_to_workspace(), cmd_move_window_to_center(), cmd_move_workspace_to_output(), cmd_rename_workspace(), con_adjacent_borders(), con_enable_fullscreen(), con_focus(), con_fullscreen_permits_focusing(), con_has_managed_window(), con_move_to_mark(), con_move_to_workspace(), con_next_focused(), con_set_layout(), con_set_urgency(), ewmh_get_workspace_index(), floating_disable(), floating_enable(), handle_button_press(), handle_client_message(), handle_configure_request(), handle_enter_notify(), handle_focus_in(), IPC_HANDLER(), json_end_map(), manage_window(), match_matches_window(), maybe_auto_back_and_forth_workspace(), maybe_back_and_forth(), move_to_output_directed(), randr_query_outputs(), route_click(), scratchpad_move(), scratchpad_show(), start_application(), TAILQ_HEAD(), tree_close_internal(), tree_move(), workspace_defer_update_urgent_hint_cb(), workspace_next(), workspace_next_on_output(), workspace_prev(), workspace_prev_on_output(), and xcb_drag_check_cb().
| bool con_has_children | ( | Con * | con | ) |
Returns true if this node has regular or floating children.
Definition at line 273 of file con.c.
References con_is_leaf(), and TAILQ_EMPTY.
Referenced by cmd_move_con_to_workspace(), cmd_move_con_to_workspace_name(), and cmd_move_con_to_workspace_number().

| bool con_has_managed_window | ( | Con * | con | ) |
Returns true when this con is a leaf node with a managed X11 window (e.g., excluding dock containers)
Definition at line 265 of file con.c.
References con_get_workspace(), Window::id, and Con::window.
Referenced by ewmh_update_wm_desktop_recursively(), and x_push_changes().

| bool con_has_mark | ( | Con * | con, |
| const char * | mark | ||
| ) |
Returns true if and only if the given containers holds the mark.
Definition at line 571 of file con.c.
References mark_t::name, and TAILQ_FOREACH.
Referenced by con_by_mark(), and con_mark_toggle().
| bool con_has_urgent_child | ( | Con * | con | ) |
Checks if the given container has an urgent child.
Definition at line 1865 of file con.c.
References con_has_urgent_child(), con_is_leaf(), TAILQ_FOREACH, and Con::urgent.
Referenced by con_has_urgent_child(), con_on_remove_child(), and con_update_parents_urgency().

Checks if the given container is either floating or inside some floating container.
It returns the FLOATING_CON container.
Definition at line 500 of file con.c.
References bfs_entry::con, con_inside_floating(), Con::floating, Con::parent, and Con::type.
Referenced by _con_move_to_con(), cmd_focus_window_mode(), cmd_move_window_to_center(), cmd_move_window_to_mouse(), cmd_resize(), cmd_resize_set(), con_inside_floating(), route_click(), scratchpad_move(), scratchpad_show(), and tree_move().

| bool con_inside_focused | ( | Con * | con | ) |
Checks if the given container is inside a focused container.
Definition at line 518 of file con.c.
References con_inside_focused(), focused, and Con::parent.
Referenced by con_inside_focused(), and x_draw_decoration().

| bool con_is_docked | ( | Con * | con | ) |
Returns true if the container is a docked container.
Definition at line 485 of file con.c.
References con_is_docked(), Con::parent, and Con::type.
Referenced by cmd_layout(), cmd_split(), con_is_docked(), and floating_enable().

| bool con_is_floating | ( | Con * | con | ) |
Returns true if the node is floating.
Definition at line 475 of file con.c.
References DLOG, and Con::floating.
Referenced by _con_move_to_con(), cmd_move_direction(), cmd_move_window_to_position(), con_adjacent_borders(), con_border_style_rect(), con_move_to_mark(), con_set_border_style(), ewmh_update_wm_desktop_recursively(), floating_disable(), floating_enable(), handle_client_message(), handle_configure_request(), toggle_floating_mode(), tree_move(), and tree_split().
| bool con_is_hidden | ( | Con * | con | ) |
This will only return true for containers which have some parent with a tabbed / stacked parent of which they are not the currently focused child.
Definition at line 300 of file con.c.
References L_STACKED, L_TABBED, Con::layout, Con::parent, TAILQ_FIRST, and Con::type.
Referenced by set_hidden_state().
| bool con_is_internal | ( | Con * | con | ) |
Returns true if the container is internal, such as __i3_scratch.
Definition at line 467 of file con.c.
References Con::name.
Referenced by _con_move_to_con(), _workspace_show(), ewmh_get_workspace_by_index(), ewmh_get_workspace_index(), ewmh_update_wm_desktop(), handle_button_press(), handle_client_message(), IPC_HANDLER(), render_con(), render_root(), scratchpad_show(), workspace_next(), and workspace_prev().
| bool con_is_leaf | ( | Con * | con | ) |
Returns true when this node is a leaf node (has no children)
Definition at line 257 of file con.c.
References TAILQ_EMPTY.
Referenced by _con_move_to_con(), con_focus(), con_force_split_parents_redraw(), con_get_tree_representation(), con_has_children(), con_has_urgent_child(), con_is_split(), con_minimum_size(), floating_set_hint_atom(), handle_configure_request(), open_placeholder_window(), render_con_split(), tiling_resize(), tree_move(), x_draw_decoration(), and x_push_node().
| bool con_is_split | ( | Con * | con | ) |
Returns true if a container should be considered split.
Definition at line 281 of file con.c.
References con_is_leaf(), L_DOCKAREA, L_OUTPUT, and Con::layout.
Referenced by con_accepts_window(), con_minimum_size(), con_move_to_mark(), dump_node(), json_end_map(), and tree_flatten().

| bool con_is_sticky | ( | Con * | con | ) |
Returns whether the container or any of its children is sticky.
Definition at line 322 of file con.c.
References con_is_sticky(), Con::sticky, and TAILQ_FOREACH.
Referenced by con_is_sticky(), ewmh_update_wm_desktop_recursively(), and output_push_sticky_windows().

| void con_mark | ( | Con * | con, |
| const char * | mark, | ||
| mark_mode_t | mode | ||
| ) |
Assigns a mark to the container.
Definition at line 602 of file con.c.
References con_unmark(), DLOG, Con::mark_changed, MM_REPLACE, mark_t::name, scalloc(), sstrdup(), TAILQ_EMPTY, TAILQ_FIRST, and TAILQ_INSERT_TAIL.
Referenced by cmd_mark(), con_mark_toggle(), and json_string().

| void con_mark_toggle | ( | Con * | con, |
| const char * | mark, | ||
| mark_mode_t | mode | ||
| ) |
Toggles the mark on a container.
If the container already has this mark, the mark is removed. Otherwise, the mark is assigned to the container.
Definition at line 587 of file con.c.
References con_has_mark(), con_mark(), con_unmark(), and DLOG.
Referenced by cmd_mark().

Determines the minimum size of the given con by looking at its children (for split/stacked/tabbed cons).
Will be called when resizing floating cons
Definition at line 1744 of file con.c.
References con_is_leaf(), con_is_split(), con_minimum_size(), Con::deco_rect, DLOG, ELOG, height, Rect::height, L_SPLITH, L_STACKED, L_TABBED, Con::layout, max(), min(), TAILQ_FIRST, TAILQ_FOREACH, Con::type, width, and Rect::width.
Referenced by con_minimum_size().

| bool con_move_to_mark | ( | Con * | con, |
| const char * | mark | ||
| ) |
Moves the given container to the given mark.
Definition at line 1091 of file con.c.
References _con_move_to_con(), con_by_mark(), con_get_workspace(), con_is_floating(), con_is_split(), con_move_to_workspace(), DLOG, Con::parent, TAILQ_FIRST, and Con::type.
Referenced by cmd_move_con_to_mark().

| void con_move_to_workspace | ( | Con * | con, |
| Con * | workspace, | ||
| bool | fix_coordinates, | ||
| bool | dont_warp, | ||
| bool | ignore_focus | ||
| ) |
Moves the given container to the currently focused container on the given workspace.
The fix_coordinates flag will translate the current coordinates (offset from the monitor position basically) to appropriate coordinates on the destination workspace. Not enabling this behaviour comes in handy when this function gets called by floating_maybe_reassign_ws, which will only "move" a floating window when it already changed its coordinates to a different output.
The dont_warp flag disables pointer warping and will be set when this function is called while dragging a floating window.
If ignore_focus is set, the container will be moved without modifying focus at all.
TODO: is there a better place for this function?
Definition at line 1147 of file con.c.
References _con_move_to_con(), con_descend_focused(), con_get_workspace(), DLOG, and Con::type.
Referenced by _con_move_to_con(), cmd_move_con_to_output(), cmd_move_con_to_workspace(), cmd_move_con_to_workspace_back_and_forth(), cmd_move_con_to_workspace_name(), cmd_move_con_to_workspace_number(), con_move_to_mark(), floating_maybe_reassign_ws(), handle_client_message(), output_push_sticky_windows(), scratchpad_move(), and scratchpad_show().

Definition at line 69 of file con.c.
References con_new_skeleton(), and x_con_init().
Referenced by _create___i3(), con_set_layout(), create_workspace_on_output(), floating_enable(), output_init_con(), tree_init(), tree_open_con(), tree_restore(), tree_split(), workspace_attach_to(), workspace_encapsulate(), workspace_get(), and ws_force_orientation().

Create a new container (and attach it to the given parent, if not NULL).
This function only initializes the data structures.
Definition at line 38 of file con.c.
References all_cons, con_attach(), con_on_remove_child(), config, Config::default_border, Window::depth, DLOG, root_depth, scalloc(), TAILQ_INIT, and TAILQ_INSERT_TAIL.
Referenced by con_new(), and TAILQ_HEAD().

Returns the container which will be focused next when the given container is not available anymore.
Called in tree_close_internal and con_move_to_workspace to properly restore focus.
Definition at line 1201 of file con.c.
References con_descend_focused(), con_get_workspace(), DLOG, focused, output_get_content(), Con::parent, TAILQ_EMPTY, TAILQ_END, TAILQ_FIRST, TAILQ_NEXT, TAILQ_PREV, and Con::type.
Referenced by _con_move_to_con(), and tree_close_internal().

| int con_num_children | ( | Con * | con | ) |
Returns the number of children of this container.
Definition at line 720 of file con.c.
References TAILQ_FOREACH.
Referenced by _tree_next(), cmd_resize_tiling_direction(), cmd_resize_tiling_width_height(), con_border_style(), con_fix_percent(), con_on_remove_child(), con_set_layout(), floating_enable(), manage_window(), output_change_mode(), render_con(), tiling_resize(), tree_move(), tree_split(), and workspace_move_to_output().
|
static |
Definition at line 1695 of file con.c.
References con_force_split_parents_redraw(), con_has_urgent_child(), con_num_children(), con_update_parents_urgency(), DLOG, DONT_KILL_WINDOW, ipc_marshal_workspace_event(), ipc_send_event(), LOG, Con::name, Con::parent, TAILQ_EMPTY, tree_close_internal(), Con::type, Con::urgent, workspace_is_visible(), and y.
Referenced by con_new_skeleton().

| orientation_t con_orientation | ( | Con * | con | ) |
Returns the orientation of the given container (for stacked containers, vertical orientation is used regardless of the actual orientation of the container).
Definition at line 1166 of file con.c.
References DLOG, HORIZ, L_DEFAULT, L_DOCKAREA, L_OUTPUT, L_SPLITH, L_SPLITV, L_STACKED, L_TABBED, Con::layout, and VERT.
Referenced by _tree_next(), cmd_resize_tiling_width_height(), con_descend_direction(), con_get_next(), con_parent_with_orientation(), dump_node(), precalculate_sizes(), resize_find_tiling_participants(), tiling_resize(), tree_flatten(), and tree_move().
| Con* con_parent_with_orientation | ( | Con * | con, |
| orientation_t | orientation | ||
| ) |
Searches parenst of the given 'con' until it reaches one with the specified 'orientation'.
Aborts when it comes across a floating_con.
Definition at line 385 of file con.c.
References con_orientation(), DLOG, Con::parent, and Con::type.
Referenced by tree_move().

Returns the window title considering the current title format.
Definition at line 2011 of file con.c.
References con_get_tree_representation(), font_is_pango(), format_placeholders(), FREE, i3string_as_utf8(), i3string_from_utf8(), i3string_set_markup(), Window::name, placeholder_t::name, pango_escape_markup(), sstrdup(), Con::title_format, and Con::window.
Referenced by cmd_title_format(), window_update_name(), window_update_name_legacy(), and x_draw_decoration().

| void con_set_border_style | ( | Con * | con, |
| int | border_style, | ||
| int | border_width | ||
| ) |
Sets the given border style on con, correctly keeping the position/size of a floating window.
Definition at line 1511 of file con.c.
References Con::border_style, BS_NORMAL, con_border_style_rect(), con_is_floating(), Con::current_border_width, DLOG, Rect::height, Con::parent, Con::rect, rect_add(), rect_sub(), render_deco_height(), and Rect::y.
Referenced by cmd_border(), and manage_window().

|
static |
Definition at line 801 of file con.c.
References CF_NONE, conn, DLOG, Con::fullscreen_mode, Window::id, ipc_send_window_event(), Con::window, xcb_add_property_atom(), and xcb_remove_property_atom().
Referenced by con_disable_fullscreen(), and con_enable_fullscreen().

This function changes the layout of a given container.
Use it to handle special cases like changing a whole workspace to stacked/tabbed (creates a new split container before).
Definition at line 1553 of file con.c.
References bfs_entry::con, con_attach(), con_detach(), con_focus(), con_force_split_parents_redraw(), con_get_workspace(), con_new(), con_num_children(), croot, DLOG, L_DEFAULT, L_SPLITH, L_SPLITV, L_STACKED, L_TABBED, Con::last_split_layout, Con::layout, Con::parent, TAILQ_EMPTY, TAILQ_END, TAILQ_FIRST, tree_flatten(), Con::type, workspace_is_visible(), and Con::workspace_layout.
Referenced by cmd_layout(), and con_toggle_layout().

| void con_set_urgency | ( | Con * | con, |
| bool | urgent | ||
| ) |
Set urgency flag to the container, all the parent containers and the workspace.
Definition at line 1907 of file con.c.
References con_get_workspace(), con_update_parents_urgency(), DLOG, focused, ipc_send_window_event(), LOG, Con::urgency_timer, Window::urgent, Con::urgent, Con::window, and workspace_update_urgent_flag().
Referenced by _con_move_to_con(), con_focus(), handle_client_message(), handle_hints(), manage_window(), tree_close_internal(), and workspace_defer_update_urgent_hint_cb().

| void con_toggle_fullscreen | ( | Con * | con, |
| int | fullscreen_mode | ||
| ) |
Toggles fullscreen mode for the given container.
Fullscreen mode will not be entered when there already is a fullscreen container on this workspace.
Definition at line 781 of file con.c.
References CF_NONE, con_disable_fullscreen(), con_enable_fullscreen(), DLOG, Con::fullscreen_mode, Con::name, and Con::type.
Referenced by _con_move_to_con(), cmd_fullscreen(), handle_client_message(), manage_window(), scratchpad_move(), and scratchpad_show().

| void con_toggle_layout | ( | Con * | con, |
| const char * | toggle_mode | ||
| ) |
This function toggles the layout of a given container.
toggle_mode can be either 'default' (toggle only between stacked/tabbed/last_split_layout), 'split' (toggle only between splitv/splith) or 'all' (toggle between all layouts).
Definition at line 1644 of file con.c.
References bfs_entry::con, con_set_layout(), DLOG, L_SPLITH, L_SPLITV, L_STACKED, L_TABBED, Con::last_split_layout, Con::layout, Con::parent, and Con::type.
Referenced by cmd_layout_toggle().

| void con_unmark | ( | Con * | con, |
| const char * | name | ||
| ) |
Definition at line 631 of file con.c.
References all_cons, bfs_entry::con, con_by_mark(), DLOG, FREE, Con::mark_changed, mark_t::name, TAILQ_EMPTY, TAILQ_FIRST, TAILQ_FOREACH, and TAILQ_REMOVE.
Referenced by cmd_unmark(), con_mark(), and con_mark_toggle().

| void con_update_parents_urgency | ( | Con * | con | ) |
Make all parent containers urgent if con is urgent or clear the urgent flag of all parent containers if there are no more urgent children left.
Definition at line 1886 of file con.c.
References con_has_urgent_child(), Con::parent, Con::type, and Con::urgent.
Referenced by con_focus(), con_on_remove_child(), con_set_urgency(), tree_close_internal(), and workspace_defer_update_urgent_hint_cb().

1.8.5