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. More... | |
Con * | tree_open_con (Con *con, i3Window *window) |
Opens an empty container in the current container. More... | |
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. More... | |
bool | level_up (void) |
Moves focus one level up. More... | |
bool | level_down (void) |
Moves focus one level down. More... | |
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(). More... | |
void | tree_close_con (kill_window_t kill_window) |
Closes the current container using tree_close(). More... | |
void | tree_next (char way, orientation_t orientation) |
Changes focus in the given way (next/previous) and given orientation (horizontal/vertical). More... | |
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. More... | |
bool | tree_restore (const char *path, xcb_get_geometry_reply_t *geometry) |
Loads tree from ~/.i3/_restart.json (used for in-place restarts). More... | |
void | tree_flatten (Con *child) |
tree_flatten() removes pairs of redundant split containers, e.g. More... | |
Variables | |
Con * | croot |
Con * | focused |
struct all_cons_head | all_cons |
bool level_down | ( | void | ) |
Moves focus one level down.
Returns true if focus changed.
Definition at line 467 of file tree.c.
References con_focus(), DLOG, TAILQ_END, TAILQ_FIRST, and Con::type.
Referenced by cmd_focus_level().
bool level_up | ( | void | ) |
Moves focus one level up.
Returns true if focus changed.
Definition at line 444 of file tree.c.
References con_focus(), ELOG, 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 190 of file tree.c.
References _is_con_mapped(), add_ignore_event(), Window::class_class, Window::class_instance, con_get_workspace(), con_next_focused(), con_update_parents_urgency(), conn, DLOG, DONT_KILL_WINDOW, FREE, i3string_free(), Window::id, Con::mapped, Window::name, Con::parent, Window::ran_assignments, root, TAILQ_FIRST, TAILQ_NEXT, tree_close(), Con::urgent, Con::window, workspace_update_urgent_flag(), 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 359 of file tree.c.
References DLOG, TAILQ_FIRST, TAILQ_NEXT, 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 694 of file tree.c.
References con_detach(), con_is_split(), con_orientation(), DLOG, DONT_KILL_WINDOW, L_OUTPUT, L_SPLITH, L_SPLITV, Con::layout, Con::name, 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(), move_to_output_directed(), 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 115 of file tree.c.
References _create___i3(), con_new(), FREE, L_SPLITH, Con::layout, 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 677 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 134 of file tree.c.
References con_descend_tiling_focused(), con_fix_percent(), con_new(), DLOG, focused, L_SPLITH, 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 507 of file tree.c.
References DLOG, Con::mapped, mark_unmapped(), render_con(), and x_push_changes().
Referenced by check_crossing_screen_boundary(), DRAGGING_CB(), floating_drag_window(), floating_reposition(), handle_button_press(), 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(), run_binding(), tiling_resize_for_border(), and workspace_defer_update_urgent_hint_cb().
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 68 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 388 of file tree.c.
References con_attach(), con_is_floating(), con_new(), con_num_children(), Con::deco_render_params, DLOG, FREE, HORIZ, L_SPLITH, L_SPLITV, Con::layout, Con::parent, Con::percent, TAILQ_REPLACE, Con::type, and workspace_encapsulate().
Referenced by cmd_split().
struct all_cons_head all_cons |
Definition at line 17 of file tree.c.
Referenced by cmd_mark(), cmd_unmark(), con_by_frame_id(), con_by_window_id(), con_new_skeleton(), IPC_HANDLER(), load_configuration(), match_matches_window(), restore_geometry(), scratchpad_show(), and TAILQ_HEAD().
Con* croot |
Definition at line 14 of file tree.c.
Referenced by cmd_append_layout(), 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(), handle_button_press(), handle_focus_in(), handle_map_request(), handle_motion_notify(), handle_screen_change(), handle_unmap_notify_event(), handle_windowname_change(), handle_windowname_change_legacy(), init_ws_for_output(), IPC_HANDLER(), load_configuration(), manage_window(), move_to_output_directed(), output_init_con(), randr_query_outputs(), scratchpad_fix_resolution(), store_restart_layout(), tree_move(), tree_restore(), workspace_get(), workspace_next(), and workspace_prev().
Con* focused |
Definition at line 15 of file tree.c.
Referenced by tree_open_con().