i3
|
#include "all.h"
Go to the source code of this file.
Data Structures | |
struct | con_state |
Typedefs | |
typedef struct con_state | con_state |
Functions | |
CIRCLEQ_HEAD (state_head, con_state) | |
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. | |
void | x_con_kill (Con *con) |
Kills the window decoration associated with the given container. | |
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). | |
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. | |
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) |
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 | x_set_i3_atoms () |
Sets up i3 specific atoms (I3_SOCKET_PATH and I3_CONFIG_PATH) | |
Variables | |
xcb_window_t | focused_id = XCB_NONE |
Stores the X11 window ID of the currently focused window. |
CIRCLEQ_HEAD | ( | state_head | , |
con_state | |||
) |
Definition at line 41 of file x.c.
References CIRCLEQ_FOREACH, ELOG, and con_state::id.
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 182 of file x.c.
References conn, xcb_icccm_get_wm_protocols, xcb_icccm_get_wm_protocols_reply, xcb_icccm_get_wm_protocols_reply_t, and xcb_icccm_get_wm_protocols_reply_wipe.
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 71 of file x.c.
References CIRCLEQ_INSERT_HEAD, conn, create_window(), DLOG, Con::frame, FRAME_EVENT_MASK, con_state::id, con_state::initial, con_state::mapped, scalloc(), and XCURSOR_CURSOR_POINTER.
Referenced by con_new().
void x_con_kill | ( | Con * | con | ) |
Kills the window decoration associated with the given container.
Definition at line 162 of file x.c.
References CIRCLEQ_REMOVE, conn, focused_id, Con::frame, FREE, con_state::name, Con::pixmap, and Con::pm_gc.
Referenced by tree_close().
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 469 of file x.c.
References conn, Con::frame, Rect::height, Con::mapped, con_state::mapped, Con::pixmap, Con::pm_gc, Con::rect, TAILQ_EMPTY, TAILQ_FOREACH, Con::type, Rect::width, x_deco_recurse(), and x_draw_decoration().
Referenced by handle_expose_event(), 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 241 of file x.c.
References Colortriple::background, Config::config_client::background, deco_render_params::background, Colortriple::border, deco_render_params::border_style, BS_1PIXEL, BS_NONE, BS_NORMAL, Config::client, deco_render_params::color, con_border_style(), con_border_style_rect(), deco_render_params::con_deco_rect, deco_render_params::con_is_leaf, con_is_leaf(), deco_render_params::con_rect, deco_render_params::con_window_rect, config, conn, Con::deco_rect, Con::deco_render_params, DLOG, Config::config_client::focused, focused, Config::config_client::focused_inactive, Config::font, deco_render_params::font, Con::frame, FREE, Font::height, height, Rect::height, Font::id, Con::layout, Window::name_len, Window::name_x, Window::name_x_changed, Con::parent, Con::pixmap, Con::pixmap_recreated, Con::pm_gc, Con::rect, scalloc(), TAILQ_FIRST, TAILQ_NEXT, Colortriple::text, Con::type, Config::config_client::unfocused, Config::config_client::urgent, Con::urgent, Window::uses_net_wm_name, width, Rect::width, Con::window, Con::window_rect, x, Rect::x, xcb_change_gc_single(), y, and Rect::y.
Referenced by x_deco_recurse().
Moves a child window from Container src to Container dest.
Definition at line 138 of file x.c.
References DLOG, ELOG, Con::frame, 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 744 of file x.c.
References CHILD_EVENT_MASK, CIRCLEQ_END, CIRCLEQ_FOREACH, CIRCLEQ_FOREACH_REVERSE, CIRCLEQ_INSERT_TAIL, CIRCLEQ_PREV, CIRCLEQ_REMOVE, conn, DLOG, ewmh_update_active_window(), focused, focused_id, Con::frame, FRAME_EVENT_MASK, Window::id, con_state::id, con_state::initial, Con::mapped, con_state::mapped, Con::name, Window::needs_take_focus, root, send_take_focus(), to_focus, con_state::unmap_now, Con::window, x_deco_recurse(), x_push_node(), and x_push_node_unmaps().
Referenced by DRAGGING_CB(), handle_client_message(), handle_focus_in(), handle_map_request(), handle_motion_notify(), handle_unmap_notify_event(), 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 497 of file x.c.
References CHILD_EVENT_MASK, con_state::child_mapped, conn, Con::deco_rect, DLOG, fake_absolute_configure_notify(), focused, Con::frame, FRAME_EVENT_MASK, FREE, Rect::height, Window::id, Con::ignore_unmap, con_state::initial, Con::layout, con_state::mapped, Con::mapped, con_state::name, con_state::need_reparent, con_state::old_frame, Con::parent, Con::pixmap, Con::pixmap_recreated, Con::pm_gc, Con::rect, con_state::rect, root_depth, TAILQ_FIRST, TAILQ_FOREACH, con_state::unmap_now, Rect::width, Con::window, Con::window_rect, con_state::window_rect, Rect::x, x_deco_recurse(), x_push_node(), XCB_ICCCM_WM_STATE_NORMAL, xcb_set_window_rect(), and Rect::y.
Referenced by DRAGGING_CB(), x_push_changes(), and x_push_node().
static void x_push_node_unmaps | ( | Con * | con | ) | [static] |
Definition at line 694 of file x.c.
References conn, DLOG, Con::frame, Window::id, Con::ignore_unmap, Con::mapped, con_state::mapped, TAILQ_FOREACH, con_state::unmap_now, Con::window, and XCB_ICCCM_WM_STATE_WITHDRAWN.
Referenced by x_push_changes().
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 864 of file x.c.
References CIRCLEQ_INSERT_HEAD, CIRCLEQ_REMOVE, and Con::frame.
Referenced by render_con(), and render_l_output().
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 104 of file x.c.
References con_state::child_mapped, DLOG, ELOG, Con::frame, con_state::initial, and con_state::window_rect.
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 123 of file x.c.
References ELOG, Con::frame, con_state::need_reparent, and con_state::old_frame.
Referenced by workspace_reassign_sticky().
void x_set_i3_atoms | ( | ) |
Sets up i3 specific atoms (I3_SOCKET_PATH and I3_CONFIG_PATH)
Definition at line 895 of file x.c.
References conn, current_configpath, current_socketpath, and root.
Referenced by 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 879 of file x.c.
References ELOG, Con::frame, FREE, con_state::name, and sstrdup().
Referenced by floating_enable(), init_ws_for_output(), manage_window(), output_init_con(), and workspace_get().
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 205 of file x.c.
References conn, KILL_WINDOW, LOG, scalloc(), and window_supports_protocol().
Referenced by tree_close().
xcb_window_t focused_id = XCB_NONE |
Stores the X11 window ID of the currently focused window.
Definition at line 8 of file x.c.
Referenced by handle_focus_in(), x_con_kill(), and x_push_changes().