i3
|
#include "all.h"
Go to the source code of this file.
Functions | |
static Con * | _create___i3 (void) |
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_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. | |
bool | tree_close_internal (Con *con, kill_window_t kill_window, bool dont_kill_parent) |
Closes the given container including all children. | |
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. | |
bool | level_up (void) |
Moves focus one level up. | |
bool | level_down (void) |
Moves focus one level down. | |
static void | mark_unmapped (Con *con) |
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(). | |
static Con * | get_tree_next_workspace (Con *con, direction_t direction) |
static Con * | get_tree_next (Con *con, direction_t direction) |
void | tree_next (Con *con, direction_t direction) |
Changes focus in the given direction. | |
Con * | get_tree_next_sibling (Con *con, position_t direction) |
Get the previous / next sibling. | |
void | tree_flatten (Con *con) |
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. | |
Variables | |
struct Con * | croot |
struct Con * | focused |
struct all_cons_head | all_cons = TAILQ_HEAD_INITIALIZER(all_cons) |
|
static |
Definition at line 22 of file tree.c.
References CF_OUTPUT, con_attach(), con_fix_percent(), con_new(), croot, DLOG, FREE, Con::fullscreen_mode, Rect::height, L_OUTPUT, L_SPLITH, Con::layout, Con::name, Con::num, Con::rect, sstrdup(), Con::type, Rect::width, and x_set_name().
Referenced by tree_init(), and tree_restore().
|
static |
Definition at line 506 of file tree.c.
References BEFORE, CF_GLOBAL, CF_OUTPUT, con_fullscreen_permits_focusing(), con_get_workspace(), con_num_children(), con_orientation(), config, Config::focus_wrapping, FOCUS_WRAPPING_FORCE, FOCUS_WRAPPING_OFF, FOCUS_WRAPPING_ON, FOCUS_WRAPPING_WORKSPACE, Con::fullscreen_mode, get_tree_next_workspace(), HORIZ, orientation_from_direction(), Con::parent, position_from_direction(), TAILQ_FIRST, TAILQ_LAST, TAILQ_NEXT, TAILQ_PREV, and Con::type.
Referenced by tree_next().
Con * get_tree_next_sibling | ( | Con * | con, |
position_t | direction ) |
Get the previous / next sibling.
Definition at line 638 of file tree.c.
References BEFORE, con_fullscreen_permits_focusing(), TAILQ_NEXT, TAILQ_PREV, and to_focus.
Referenced by cmd_focus_sibling(), and route_click().
|
static |
Definition at line 472 of file tree.c.
References CF_GLOBAL, CLOSEST_OUTPUT, xoutput::con, con_get_fullscreen_con(), DLOG, get_output_containing(), get_output_next(), GREP_FIRST, Rect::height, output_get_content(), output_primary_name(), Con::rect, Rect::width, workspace_is_visible(), Rect::x, Rect::y, and y.
Referenced by get_tree_next().
bool level_down | ( | void | ) |
Moves focus one level down.
Returns true if focus changed.
Definition at line 412 of file tree.c.
References con_activate(), DLOG, focused, 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 389 of file tree.c.
References con_activate(), ELOG, focused, Con::parent, and Con::type.
Referenced by cmd_focus_level().
|
static |
Definition at line 434 of file tree.c.
References Con::mapped, mark_unmapped(), TAILQ_FOREACH, and Con::type.
Referenced by mark_unmapped(), and tree_render().
bool tree_close_internal | ( | Con * | con, |
kill_window_t | kill_window, | ||
bool | dont_kill_parent ) |
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.
Definition at line 192 of file tree.c.
References add_ignore_event(), CALL, con_activate(), con_detach(), con_fix_percent(), con_free(), con_get_workspace(), con_next_focused(), con_set_urgency(), con_update_parents_urgency(), conn, DLOG, DONT_KILL_WINDOW, ewmh_update_desktop_properties(), focused, FREE, Window::id, ipc_send_window_event(), main_loop, Con::name, Con::parent, Con::rect, root, shape_supported, TAILQ_FIRST, TAILQ_NEXT, tree_close_internal(), tree_render(), Con::type, Con::urgency_timer, Con::urgent, Con::window, window_free(), workspace_update_urgent_flag(), Rect::x, x_con_kill(), x_window_kill(), and Rect::y.
Referenced by con_close(), con_merge_into(), con_on_remove_child(), con_set_layout(), floating_disable(), floating_enable(), handle_client_message(), handle_unmap_notify_event(), move_content(), tree_close_internal(), tree_flatten(), and workspace_show().
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 660 of file tree.c.
References con_detach(), con_is_split(), con_orientation(), DLOG, DONT_KILL_WINDOW, focused, 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_internal(), 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 130 of file tree.c.
References _create___i3(), con_new(), croot, FREE, L_SPLITH, Con::layout, Con::name, Con::rect, and Con::type.
Referenced by main().
void tree_next | ( | Con * | con, |
direction_t | direction ) |
Changes focus in the given direction.
Definition at line 596 of file tree.c.
References CF_NONE, con_activate(), con_descend_focused(), con_descend_tiling_focused(), con_get_workspace(), Con::fullscreen_mode, get_tree_next(), Con::parent, Con::rect, TAILQ_INSERT_HEAD, TAILQ_LAST, TAILQ_REMOVE, Con::type, workspace_show(), and x_set_warp_to().
Referenced by cmd_focus_direction().
Opens an empty container in the current container.
Definition at line 149 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 455 of file tree.c.
References croot, DLOG, Con::mapped, mark_unmapped(), render_con(), and x_push_changes().
Referenced by allow_replay_pointer(), check_crossing_screen_boundary(), DRAGGING_CB(), floating_drag_window(), floating_reposition(), floating_resize_window(), handle_button_press(), handle_client_message(), handle_configure_request(), handle_enter_notify(), handle_focus_in(), handle_hints(), handle_net_wm_state_change(), handle_normal_hints(), handle_strut_partial_change(), handle_unmap_notify_event(), IPC_HANDLER(), load_configuration(), main(), manage_window(), randr_query_outputs(), resize_graphical_handler(), run_assignments(), run_binding(), tiling_drag(), tiling_resize_for_border(), tree_close_internal(), 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 66 of file tree.c.
References _create___i3(), con_new(), croot, DLOG, focused, LOG, Con::name, path_exists(), Con::rect, resolve_tilde(), restore_open_placeholder_windows(), slurp(), TAILQ_FIRST, TAILQ_INSERT_HEAD, TAILQ_REMOVE, and tree_append_json().
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 330 of file tree.c.
References con_attach(), con_force_split_parents_redraw(), con_is_floating(), con_new(), con_num_children(), DLOG, focused, HORIZ, L_DEFAULT, L_SPLITH, L_SPLITV, Con::layout, Con::parent, Con::percent, TAILQ_REPLACE, Con::type, workspace_encapsulate(), and Con::workspace_layout.
Referenced by cmd_split(), and tiling_drag().
struct all_cons_head all_cons = TAILQ_HEAD_INITIALIZER(all_cons) |
Definition at line 15 of file tree.c.
Referenced by con_by_con_id(), con_by_frame_id(), con_by_mark(), con_by_window_id(), con_free(), con_new_skeleton(), con_unmark(), find_drop_target(), free_configuration(), has_drop_targets(), init_ws_for_output(), IPC_HANDLER(), match_matches_window(), regrab_all_buttons(), restore_geometry(), scratchpad_show(), and TAILQ_HEAD().
struct Con* croot |
Definition at line 12 of file tree.c.
Referenced by _create___i3(), cmd_append_layout(), cmd_move_window_to_center(), con_enable_fullscreen(), con_find_transient_for_window(), con_get_fullscreen_covering_ws(), con_set_layout(), disable_global_fullscreen(), DRAGGING_CB(), ewmh_update_wm_desktop(), gaps_reapply_workspace_assignments(), gaps_update(), get_existing_workspace_by_name(), get_existing_workspace_by_num(), handle_button_press(), handle_focus_in(), handle_motif_hints_change(), handle_motion_notify(), handle_screen_change(), handle_strut_partial_change(), handle_windowicon_change(), handle_windowname_change(), handle_windowname_change_legacy(), has_drop_targets(), IPC_HANDLER(), IPC_HANDLER(), main(), manage_window(), move_to_output_directed(), output_init_con(), output_push_sticky_windows(), placeholder_for_con(), randr_query_outputs(), scratchpad_fix_resolution(), store_restart_layout(), tree_init(), tree_move(), tree_render(), tree_restore(), workspace_next(), and workspace_prev().
struct Con* focused |
Definition at line 13 of file tree.c.
Referenced by _con_attach(), _con_move_to_con(), attach_to_workspace(), CFGFUN(), check_crossing_screen_boundary(), cmd_append_layout(), cmd_focus_level(), cmd_focus_output(), cmd_focus_window_mode(), cmd_layout_toggle(), cmd_move_con_to_workspace(), cmd_rename_workspace(), cmd_sticky(), con_activate_unblock(), con_close(), con_descend_direction(), con_descend_focused(), con_descend_tiling_focused(), con_detach(), con_enable_fullscreen(), con_focus(), con_fullscreen_permits_focusing(), con_inside_focused(), con_next_focused(), con_set_urgency(), con_swap(), drain_drag_events(), dump_node(), ewmh_update_current_desktop(), floating_enable(), gaps_update(), get_focus_order(), get_output_from_string(), handle_button_press(), handle_client_message(), handle_enter_notify(), handle_focus_in(), handle_net_wm_state_change(), has_drop_targets(), init_ws_for_output(), insert_con_into(), IPC_HANDLER(), json_end_array(), level_down(), level_up(), manage_window(), match_matches_window(), match_parse_property(), maybe_auto_back_and_forth_workspace(), maybe_back_and_forth(), move_content(), move_to_output_directed(), num_focus_heads(), output_init_con(), output_push_sticky_windows(), render_con(), route_click(), scratchpad_move(), scratchpad_show(), set_focus_order(), start_application(), tiling_drag(), tree_close_internal(), tree_flatten(), tree_open_con(), tree_restore(), tree_split(), workspace_get(), workspace_next(), workspace_next_on_output(), workspace_prev(), workspace_prev_on_output(), workspace_show(), x_draw_decoration(), x_push_changes(), and x_push_node().