i3
|
Go to the source code of this file.
Functions | |
TAILQ_HEAD (all_cons_head, Con) | |
void | tree_init (xcb_get_geometry_reply_t *geometry) |
Initializes the tree by creating the root node, adding all RandR outputs to the tree (that means randr_init() has to be called before) and assigning a workspace to each RandR output. | |
Con * | tree_open_con (Con *con, i3Window *window) |
Opens an empty container in the current container. | |
void | tree_split (Con *con, orientation_t orientation) |
Splits (horizontally or vertically) the given container by creating a new container which contains the old one and the future ones. | |
void | level_up (void) |
Moves focus one level up. | |
void | level_down (void) |
Moves focus one level down. | |
void | tree_render (void) |
Renders the tree, that is rendering all outputs using render_con() and pushing the changes to X11 using x_push_changes(). | |
void | tree_close_con (kill_window_t kill_window) |
Closes the current container using tree_close(). | |
void | tree_next (char way, orientation_t orientation) |
Changes focus in the given way (next/previous) and given orientation (horizontal/vertical). | |
bool | tree_close (Con *con, kill_window_t kill_window, bool dont_kill_parent, bool force_set_focus) |
Closes the given container including all children. | |
bool | tree_restore (const char *path, xcb_get_geometry_reply_t *geometry) |
Loads tree from ~/.i3/_restart.json (used for in-place restarts). | |
void | tree_flatten (Con *child) |
tree_flatten() removes pairs of redundant split containers, e.g. |
Variables | |
Con * | croot |
Con * | focused |
struct all_cons_head | all_cons |
void level_down | ( | void | ) |
Moves focus one level down.
Definition at line 402 of file tree.c.
References con_focus(), TAILQ_END, and TAILQ_FIRST.
Referenced by cmd_focus_level().
void level_up | ( | void | ) |
Moves focus one level up.
Definition at line 381 of file tree.c.
References con_focus(), Con::fullscreen_mode, LOG, Con::parent, and Con::type.
Referenced by cmd_focus_level().
TAILQ_HEAD | ( | all_cons_head | , |
Con | |||
) |
bool tree_close | ( | Con * | con, |
kill_window_t | kill_window, | ||
bool | dont_kill_parent, | ||
bool | force_set_focus | ||
) |
Closes the given container including all children.
Returns true if the container was killed or false if just WM_DELETE was sent and the window is expected to kill itself.
The dont_kill_parent flag is specified when the function calls itself recursively while deleting a containers children.
The force_set_focus flag is specified in the case of killing a floating window: tree_close() will be invoked for the CT_FLOATINGCON (the parent container) and focus should be set there.
Definition at line 184 of file tree.c.
References _is_con_mapped(), add_ignore_event(), all_cons, CALL, Window::class_class, Window::class_instance, con_descend_focused(), con_detach(), con_fix_percent(), con_focus(), con_get_workspace(), con_is_floating(), con_next_focused(), conn, Con::deco_render_params, DLOG, DONT_KILL_WINDOW, FREE, Window::id, Con::mapped, Con::name, Window::name_json, Window::name_x, output_get_content(), Con::parent, root, TAILQ_FIRST, TAILQ_NEXT, TAILQ_REMOVE, tree_close(), Con::type, Con::window, x_con_kill(), x_window_kill(), and XCB_ICCCM_WM_STATE_WITHDRAWN.
Referenced by _workspace_show(), cmd_kill(), con_on_remove_child(), floating_disable(), floating_enable(), handle_unmap_notify_event(), randr_query_outputs(), tree_close(), tree_close_con(), and tree_flatten().
void tree_close_con | ( | kill_window_t | kill_window | ) |
Closes the current container using tree_close().
Definition at line 316 of file tree.c.
References LOG, tree_close(), and Con::type.
Referenced by cmd_kill().
void tree_flatten | ( | Con * | child | ) |
tree_flatten() removes pairs of redundant split containers, e.g.
: [workspace, horizontal] [v-split] [child3] [h-split] [child1] [child2] In this example, the v-split and h-split container are redundant. Such a situation can be created by moving containers in a direction which is not the orientation of their parent container. i3 needs to create a new split container then and if you move containers this way multiple times, redundant chains of split-containers can be the result.
Definition at line 592 of file tree.c.
References con_detach(), DLOG, DONT_KILL_WINDOW, Con::name, NO_ORIENTATION, Con::orientation, Con::parent, Con::percent, TAILQ_EMPTY, TAILQ_FIRST, TAILQ_INSERT_BEFORE, TAILQ_INSERT_HEAD, TAILQ_INSERT_TAIL, TAILQ_NEXT, TAILQ_REMOVE, tree_close(), tree_flatten(), Con::type, and Con::window.
Referenced by con_set_layout(), tree_flatten(), and tree_move().
void tree_init | ( | xcb_get_geometry_reply_t * | geometry | ) |
Initializes the tree by creating the root node, adding all RandR outputs to the tree (that means randr_init() has to be called before) and assigning a workspace to each RandR output.
Definition at line 110 of file tree.c.
References _create___i3(), con_new(), FREE, Con::name, Con::rect, Con::type, and Rect::x.
Referenced by main().
void tree_next | ( | char | way, |
orientation_t | orientation | ||
) |
Changes focus in the given way (next/previous) and given orientation (horizontal/vertical).
Definition at line 575 of file tree.c.
References _tree_next().
Referenced by cmd_focus_direction(), and route_click().
Opens an empty container in the current container.
Definition at line 129 of file tree.c.
References con_descend_tiling_focused(), con_fix_percent(), con_new(), DLOG, focused, Con::parent, and Con::type.
Referenced by cmd_open(), and manage_window().
void tree_render | ( | void | ) |
Renders the tree, that is rendering all outputs using render_con() and pushing the changes to X11 using x_push_changes().
Definition at line 431 of file tree.c.
References DLOG, Con::mapped, mark_unmapped(), render_con(), and x_push_changes().
Referenced by check_crossing_screen_boundary(), cmd_workspace_name(), DRAGGING_CB(), floating_drag_window(), floating_reposition(), handle_client_message(), handle_configure_request(), handle_enter_notify(), handle_hints(), handle_key_press(), handle_normal_hints(), handle_unmap_notify_event(), IPC_HANDLER(), main(), manage_window(), randr_query_outputs(), route_click(), run_assignments(), and tiling_resize_for_border().
bool tree_restore | ( | const char * | path, |
xcb_get_geometry_reply_t * | geometry | ||
) |
Loads tree from ~/.i3/_restart.json (used for in-place restarts).
Definition at line 62 of file tree.c.
References _create___i3(), con_new(), croot, DLOG, LOG, Con::name, path_exists(), Con::rect, resolve_tilde(), TAILQ_FIRST, TAILQ_INSERT_HEAD, TAILQ_REMOVE, tree_append_json(), and Rect::x.
Referenced by main().
void tree_split | ( | Con * | con, |
orientation_t | orientation | ||
) |
Splits (horizontally or vertically) the given container by creating a new container which contains the old one and the future ones.
Definition at line 336 of file tree.c.
References con_attach(), con_new(), con_num_children(), Con::deco_render_params, DLOG, FREE, Con::layout, Con::orientation, Con::parent, Con::percent, TAILQ_REPLACE, and Con::type.
Referenced by cmd_split().
struct all_cons_head all_cons |
Definition at line 15 of file tree.c.
Referenced by cmd_criteria_init(), cmd_mark(), con_by_frame_id(), con_by_window_id(), con_new(), IPC_HANDLER(), load_configuration(), match_matches_window(), restore_geometry(), and tree_close().
Con* croot |
Definition at line 12 of file tree.c.
Referenced by cmd_move_con_to_workspace_number(), cmd_move_window_to_center(), cmd_move_workspace_to_output(), cmd_rename_workspace(), cmd_workspace_number(), con_set_layout(), con_toggle_fullscreen(), create_workspace_on_output(), DRAGGING_CB(), ewmh_update_current_desktop(), ewmh_update_workarea(), handle_client_message(), handle_focus_in(), handle_map_request(), handle_motion_notify(), handle_unmap_notify_event(), handle_windowname_change(), handle_windowname_change_legacy(), init_ws_for_output(), IPC_HANDLER(), load_configuration(), manage_window(), output_init_con(), randr_query_outputs(), store_restart_layout(), tree_move(), tree_restore(), workspace_get(), workspace_next(), and workspace_prev().