i3
|
Go to the source code of this file.
Data Structures | |
struct | con_state |
Macros | |
#define | MAX(x, y) |
Typedefs | |
typedef struct con_state | con_state |
Functions | |
CIRCLEQ_HEAD (state_head, con_state) | |
static void | change_ewmh_focus (xcb_window_t new_focus, xcb_window_t old_focus) |
void | x_con_init (Con *con) |
Initializes the X11 part for the given container. | |
void | x_reinit (Con *con) |
Re-initializes the associated X window state for this container. | |
void | x_reparent_child (Con *con, Con *old) |
Reparents the child window of the given container (necessary for sticky containers). | |
void | x_move_win (Con *src, Con *dest) |
Moves a child window from Container src to Container dest. | |
static void | _x_con_kill (Con *con) |
void | x_con_kill (Con *con) |
Kills the window decoration associated with the given container. | |
void | x_con_reframe (Con *con) |
bool | window_supports_protocol (xcb_window_t window, xcb_atom_t atom) |
Returns true if the client supports the given protocol atom (like WM_DELETE_WINDOW) | |
void | x_window_kill (xcb_window_t window, kill_window_t kill_window) |
Kills the given X11 window using WM_DELETE_WINDOW (if supported). | |
static void | x_draw_title_border (Con *con, struct deco_render_params *p, surface_t *dest_surface) |
static void | x_draw_decoration_after_title (Con *con, struct deco_render_params *p, surface_t *dest_surface) |
static size_t | x_get_border_rectangles (Con *con, xcb_rectangle_t rectangles[4]) |
void | x_draw_decoration (Con *con) |
Draws the decoration of the given container onto its parent. | |
void | x_deco_recurse (Con *con) |
Recursively calls x_draw_decoration. | |
static void | set_hidden_state (Con *con) |
static void | set_maximized_state (Con *con) |
static void | x_shape_frame (Con *con, xcb_shape_sk_t shape_kind) |
static void | x_unshape_frame (Con *con, xcb_shape_sk_t shape_kind) |
static void | set_shape_state (Con *con, bool need_reshape) |
void | x_push_node (Con *con) |
This function pushes the properties of each node of the layout tree to X11 if they have changed (like the map state, position of the window, …). | |
static void | x_push_node_unmaps (Con *con) |
static bool | is_con_attached (Con *con) |
void | x_push_changes (Con *con) |
Pushes all changes (state of each node, see x_push_node() and the window stack) to X11. | |
void | x_raise_con (Con *con) |
Raises the specified container in the internal stack of X windows. | |
void | x_set_name (Con *con, const char *name) |
Sets the WM_NAME property (so, no UTF8, but used only for debugging anyways) of the given name. | |
void | update_shmlog_atom (void) |
Set up the SHMLOG_PATH atom. | |
void | x_set_i3_atoms (void) |
Sets up i3 specific atoms (I3_SOCKET_PATH and I3_CONFIG_PATH) | |
void | x_set_warp_to (Rect *rect) |
Set warp_to coordinates. | |
void | x_mask_event_mask (uint32_t mask) |
Applies the given mask to the event mask of every i3 window decoration X11 window. | |
void | x_set_shape (Con *con, xcb_shape_sk_t kind, bool enable) |
Enables or disables nonrectangular shape of the container frame. | |
Variables | |
xcb_window_t | focused_id = XCB_NONE |
Stores the X11 window ID of the currently focused window. | |
static xcb_window_t | last_focused = XCB_NONE |
static Rect * | warp_to |
#define MAX | ( | x, | |
y ) |
typedef struct con_state con_state |
|
static |
Definition at line 256 of file x.c.
References CIRCLEQ_REMOVE, Con::colormap, con_state::con, conn, draw_util_surface_free(), focused_id, Con::frame, Con::frame_buffer, FREE, surface_t::id, last_focused, state, and TAILQ_REMOVE.
Referenced by x_con_kill(), and x_con_reframe().
|
static |
Definition at line 108 of file x.c.
References ewmh_update_active_window(), and ewmh_update_focused().
Referenced by x_push_changes().
|
static |
Definition at line 1244 of file x.c.
References con_state::con, Con::parent, and TAILQ_FOREACH.
Referenced by x_push_changes().
|
static |
Definition at line 811 of file x.c.
References con_is_hidden(), conn, DLOG, Con::frame, surface_t::id, Window::id, state, Con::window, xcb_add_property_atom(), and xcb_remove_property_atom().
Referenced by x_push_node().
|
static |
Definition at line 837 of file x.c.
References con_is_maximized(), conn, DLOG, Con::frame, HORIZ, surface_t::id, Window::id, Con::name, state, VERT, Con::window, xcb_add_property_atom(), and xcb_remove_property_atom().
Referenced by x_push_node().
|
static |
Definition at line 904 of file x.c.
References con_state::con, con_is_floating(), ELOG, Con::frame, surface_t::id, Window::input_shaped, shape_supported, Window::shaped, state, Con::window, x_shape_frame(), and x_unshape_frame().
Referenced by x_push_node().
void update_shmlog_atom | ( | void | ) |
Set up the SHMLOG_PATH atom.
Definition at line 1513 of file x.c.
References conn, root, and shmlogname.
Referenced by cmd_shmlog(), and x_set_i3_atoms().
bool window_supports_protocol | ( | xcb_window_t | window, |
xcb_atom_t | atom ) |
Returns true if the client supports the given protocol atom (like WM_DELETE_WINDOW)
Definition at line 305 of file x.c.
References conn.
Referenced by manage_window(), and x_window_kill().
void x_con_init | ( | Con * | con | ) |
Initializes the X11 part for the given container.
Called exactly once for every container from con_new().
Definition at line 129 of file x.c.
References CIRCLEQ_INSERT_HEAD, colormap, Con::colormap, con_state::con, conn, create_window(), Con::depth, DLOG, draw_util_surface_init(), Con::frame, FRAME_EVENT_MASK, get_visualid_by_depth(), get_visualtype_by_id(), Rect::height, surface_t::id, root, root_depth, root_screen, scalloc(), state, TAILQ_INSERT_TAIL, Rect::width, and XCURSOR_CURSOR_POINTER.
Referenced by con_new(), json_end_map(), and x_con_reframe().
void x_con_kill | ( | Con * | con | ) |
Kills the window decoration associated with the given container.
Definition at line 287 of file x.c.
References _x_con_kill(), con_state::con, conn, Con::frame, and surface_t::id.
Referenced by tree_close_internal().
void x_con_reframe | ( | Con * | con | ) |
Definition at line 296 of file x.c.
References _x_con_kill(), con_state::con, and x_con_init().
Referenced by _match_depth().
void x_deco_recurse | ( | Con * | con | ) |
Recursively calls x_draw_decoration.
This cannot be done in x_push_node because x_push_node uses focus order to recurse (see the comment above) while drawing the decoration needs to happen in the actual order.
Definition at line 781 of file x.c.
References draw_util_copy_surface(), Con::frame, Con::frame_buffer, Rect::height, surface_t::id, Con::mapped, Con::rect, state, TAILQ_EMPTY, TAILQ_FOREACH, Con::type, Rect::width, x_deco_recurse(), and x_draw_decoration().
Referenced by x_deco_recurse(), x_push_changes(), and x_push_node().
void x_draw_decoration | ( | Con * | con | ) |
Draws the decoration of the given container onto its parent.
Definition at line 462 of file x.c.
References Colortriple::background, Config::config_client::background, deco_render_params::background, deco_render_params::border_style, BS_NONE, BS_NORMAL, Colortriple::child_border, Config::client, deco_render_params::color, con_state::con, con_border_style(), con_border_style_rect(), deco_render_params::con_deco_rect, con_descend_focused(), con_draw_decoration_into_frame(), con_get_tree_representation(), con_inside_focused(), con_is_leaf(), deco_render_params::con_is_leaf, con_parse_title_format(), deco_render_params::con_rect, deco_render_params::con_window_rect, config, Con::deco_rect, Con::deco_render_params, DLOG, draw_util_clear_surface(), draw_util_copy_surface(), draw_util_image(), draw_util_rectangle(), draw_util_text(), ELOG, Config::config_client::focused, focused, Config::config_client::focused_inactive, Config::config_client::focused_tab_title, Config::font, Con::frame, Con::frame_buffer, FREE, Config::config_client::got_focused_tab_title, Font::height, Rect::height, surface_t::height, I3STRING_FREE, i3string_from_utf8(), Window::icon, surface_t::id, Colortriple::indicator, L_SPLITH, L_SPLITV, L_STACKED, L_TABBED, Con::layout, logical_px(), Con::mark_changed, marks, max(), min(), Con::name, mark_t::name, Window::name, Window::name_x_changed, Con::parent, deco_render_params::parent_layout, Con::pixmap_recreated, predict_text_width(), Con::rect, sasprintf(), scalloc(), Config::show_marks, sstrdup(), TAILQ_EMPTY, TAILQ_FIRST, TAILQ_FOREACH, TAILQ_NEXT, TAILQ_PREV, Colortriple::text, Config::title_align, Con::title_format, Con::type, Config::config_client::unfocused, Con::urgent, Config::config_client::urgent, width_height::w, Rect::width, surface_t::width, Con::window, Con::window_icon_padding, Con::window_rect, Rect::x, x_draw_decoration_after_title(), x_draw_title_border(), x_get_border_rectangles(), and Rect::y.
Referenced by x_deco_recurse().
|
static |
Definition at line 383 of file x.c.
References Colortriple::background, deco_render_params::color, con_state::con, Con::deco_rect, draw_util_rectangle(), font_is_pango(), Rect::height, logical_px(), Con::parent, Rect::width, Rect::x, x_draw_title_border(), and Rect::y.
Referenced by x_draw_decoration().
|
static |
Definition at line 363 of file x.c.
References Colortriple::border, deco_render_params::color, con_state::con, Con::deco_rect, draw_util_rectangle(), Rect::height, Rect::width, Rect::x, and Rect::y.
Referenced by x_draw_decoration(), and x_draw_decoration_after_title().
|
static |
Definition at line 412 of file x.c.
References ADJ_LEFT_SCREEN_EDGE, ADJ_LOWER_SCREEN_EDGE, ADJ_RIGHT_SCREEN_EDGE, ADJ_UPPER_SCREEN_EDGE, BS_NONE, BS_PIXEL, con_state::con, con_adjacent_borders(), con_border_style(), con_border_style_rect(), con_is_leaf(), config, Rect::height, Config::hide_edge_borders, Con::rect, Rect::width, Rect::x, Rect::y, and y.
Referenced by x_draw_decoration(), and x_shape_frame().
void x_mask_event_mask | ( | uint32_t | mask | ) |
Applies the given mask to the event mask of every i3 window decoration X11 window.
This is useful to disable EnterNotify while resizing so that focus is untouched.
Definition at line 1557 of file x.c.
References CIRCLEQ_FOREACH_REVERSE, conn, FRAME_EVENT_MASK, and state.
Referenced by DRAGGING_CB(), resize_graphical_handler(), and tiling_drag().
Moves a child window from Container src to Container dest.
Definition at line 234 of file x.c.
References con_state::con, DLOG, ELOG, Con::frame, surface_t::id, rect_equals(), and con_state::window_rect.
Referenced by workspace_reassign_sticky().
void x_push_changes | ( | Con * | con | ) |
Pushes all changes (state of each node, see x_push_node() and the window stack) to X11.
Definition at line 1270 of file x.c.
References change_ewmh_focus(), CHILD_EVENT_MASK, CIRCLEQ_END, CIRCLEQ_FOREACH, CIRCLEQ_FOREACH_REVERSE, CIRCLEQ_INSERT_TAIL, CIRCLEQ_PREV, CIRCLEQ_REMOVE, con_state::con, con_has_managed_window(), conn, DLOG, Window::doesnt_accept_focus, ELOG, ewmh_update_client_list(), ewmh_update_client_list_stacking(), ewmh_window, focused, focused_id, Con::frame, FRAME_EVENT_MASK, get_output_containing(), Rect::height, con_state::id, surface_t::id, Window::id, ipc_send_window_event(), is_con_attached(), last_focused, last_timestamp, Con::mapped, Con::name, Window::needs_take_focus, root, ROOT_EVENT_MASK, send_take_focus(), srealloc(), state, TAILQ_FOREACH, to_focus, warp_to, Rect::width, Con::window, Rect::x, x_deco_recurse(), x_push_node(), x_push_node_unmaps(), and Rect::y.
Referenced by DRAGGING_CB(), handle_focus_in(), handle_motif_hints_change(), handle_motion_notify(), handle_windowicon_change(), handle_windowname_change(), handle_windowname_change_legacy(), and tree_render().
void x_push_node | ( | Con * | con | ) |
This function pushes the properties of each node of the layout tree to X11 if they have changed (like the map state, position of the window, …).
It recursively traverses all children of the given node.
Definition at line 942 of file x.c.
References BS_NONE, CHILD_EVENT_MASK, con_state::con, con_border_style(), con_is_floating(), con_is_leaf(), conn, Con::deco_rect, Window::depth, DLOG, draw_util_clear_surface(), draw_util_copy_surface(), draw_util_surface_free(), draw_util_surface_init(), draw_util_surface_set_size(), fake_absolute_configure_notify(), focused, Con::frame, Con::frame_buffer, FRAME_EVENT_MASK, FREE, surface_t::gc, get_visualid_by_depth(), get_visualtype_by_id(), Rect::height, surface_t::id, Window::id, Con::ignore_unmap, L_STACKED, L_TABBED, Con::layout, Con::mapped, MAX, Con::parent, Con::pixmap_recreated, Con::rect, con_state::rect, rect_equals(), root_depth, set_hidden_state(), set_maximized_state(), set_shape_state(), state, TAILQ_FIRST, TAILQ_FOREACH, Con::type, Rect::width, Con::window, Con::window_rect, Rect::x, x_deco_recurse(), x_push_node(), xcb_set_window_rect(), and Rect::y.
Referenced by DRAGGING_CB(), x_push_changes(), and x_push_node().
|
static |
Definition at line 1199 of file x.c.
References con_state::con, conn, DLOG, Con::frame, surface_t::id, Window::id, Con::ignore_unmap, Con::mapped, Con::name, state, TAILQ_FOREACH, Con::window, and x_push_node_unmaps().
Referenced by x_push_changes(), and x_push_node_unmaps().
void x_raise_con | ( | Con * | con | ) |
Raises the specified container in the internal stack of X windows.
The next call to x_push_changes() will make the change visible in X11.
Definition at line 1483 of file x.c.
References CIRCLEQ_INSERT_HEAD, CIRCLEQ_REMOVE, con_state::con, Con::frame, surface_t::id, and state.
Referenced by render_con(), render_output(), and render_root().
void x_reinit | ( | Con * | con | ) |
Re-initializes the associated X window state for this container.
You have to call this when you assign a client to an empty container to ensure that its state gets updated correctly.
Definition at line 199 of file x.c.
References con_state::con, DLOG, ELOG, Con::frame, surface_t::id, and state.
Referenced by manage_window().
Reparents the child window of the given container (necessary for sticky containers).
The reparenting happens in the next call of x_push_changes().
Definition at line 219 of file x.c.
References con_state::con, ELOG, Con::frame, surface_t::id, con_state::need_reparent, and state.
Referenced by remanage_window(), and workspace_reassign_sticky().
void x_set_i3_atoms | ( | void | ) |
Sets up i3 specific atoms (I3_SOCKET_PATH and I3_CONFIG_PATH)
Definition at line 1527 of file x.c.
References conn, current_configpath, current_log_stream_socket_path, current_socketpath, root, and update_shmlog_atom().
Referenced by cmd_reload(), and main().
void x_set_name | ( | Con * | con, |
const char * | name ) |
Sets the WM_NAME property (so, no UTF8, but used only for debugging anyways) of the given name.
Used for properly tagging the windows for easily spotting i3 windows in xwininfo -root -all.
Definition at line 1497 of file x.c.
References con_state::con, ELOG, Con::frame, FREE, surface_t::id, con_state::name, sstrdup(), and state.
Referenced by _create___i3(), create_workspace_on_output(), floating_enable(), manage_window(), output_init_con(), and workspace_get().
void x_set_shape | ( | Con * | con, |
xcb_shape_sk_t | kind, | ||
bool | enable ) |
Enables or disables nonrectangular shape of the container frame.
Definition at line 1571 of file x.c.
References con_state::con, con_is_floating(), conn, ELOG, Con::frame, surface_t::id, Window::input_shaped, Window::shaped, state, Con::window, x_shape_frame(), and x_unshape_frame().
Referenced by handle_event().
void x_set_warp_to | ( | Rect * | rect | ) |
Set warp_to coordinates.
This will trigger on the next call to x_push_changes().
Definition at line 1545 of file x.c.
References config, Config::mouse_warping, POINTER_WARPING_NONE, con_state::rect, and warp_to.
Referenced by _con_move_to_con(), DRAGGING_CB(), tree_next(), and workspace_show().
|
static |
Definition at line 875 of file x.c.
References Con::border_width, conn, Con::frame, surface_t::id, Window::id, Con::window, Con::window_rect, Rect::x, x_get_border_rectangles(), and Rect::y.
Referenced by set_shape_state(), and x_set_shape().
|
static |
Definition at line 895 of file x.c.
References conn, Con::frame, surface_t::id, and Con::window.
Referenced by set_shape_state(), and x_set_shape().
void x_window_kill | ( | xcb_window_t | window, |
kill_window_t | kill_window ) |
Kills the given X11 window using WM_DELETE_WINDOW (if supported).
Definition at line 331 of file x.c.
References conn, KILL_WINDOW, LOG, scalloc(), and window_supports_protocol().
Referenced by tree_close_internal().
xcb_window_t focused_id = XCB_NONE |
Stores the X11 window ID of the currently focused window.
Definition at line 20 of file x.c.
Referenced by _x_con_kill(), handle_client_message(), handle_enter_notify(), handle_focus_in(), and x_push_changes().
|
static |
Definition at line 25 of file x.c.
Referenced by _x_con_kill(), and x_push_changes().
|
static |
Definition at line 28 of file x.c.
Referenced by x_push_changes(), and x_set_warp_to().