i3
Functions | Variables
x.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void x_con_init (Con *con, uint16_t depth)
 Initializes the X11 part for the given container. More...
 
void x_move_win (Con *src, Con *dest)
 Moves a child window from Container src to Container dest. More...
 
void x_reparent_child (Con *con, Con *old)
 Reparents the child window of the given container (necessary for sticky containers). More...
 
void x_reinit (Con *con)
 Re-initializes the associated X window state for this container. More...
 
void x_con_kill (Con *con)
 Kills the window decoration associated with the given container. More...
 
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) More...
 
void x_window_kill (xcb_window_t window, kill_window_t kill_window)
 Kills the given X11 window using WM_DELETE_WINDOW (if supported). More...
 
void x_draw_decoration (Con *con)
 Draws the decoration of the given container onto its parent. More...
 
void x_deco_recurse (Con *con)
 Recursively calls x_draw_decoration. More...
 
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, …). More...
 
void x_push_changes (Con *con)
 Pushes all changes (state of each node, see x_push_node() and the window stack) to X11. More...
 
void x_raise_con (Con *con, bool above_all)
 Raises the specified container in the internal stack of X windows. More...
 
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. More...
 
void update_shmlog_atom (void)
 Set up the SHMLOG_PATH atom. More...
 
void x_set_i3_atoms (void)
 Sets up i3 specific atoms (I3_SOCKET_PATH and I3_CONFIG_PATH) More...
 
void x_set_warp_to (Rect *rect)
 Set warp_to coordinates. More...
 
void x_mask_event_mask (uint32_t mask)
 Applies the given mask to the event mask of every i3 window decoration X11 window. More...
 

Variables

xcb_window_t focused_id
 Stores the X11 window ID of the currently focused window. More...
 

Function Documentation

void update_shmlog_atom ( void  )

Set up the SHMLOG_PATH atom.

Definition at line 1070 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 243 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,
uint16_t  depth 
)

Initializes the X11 part for the given container.

Called exactly once for every container from con_new().

Definition at line 91 of file x.c.

References CIRCLEQ_INSERT_HEAD, colormap, conn, create_window(), DLOG, Con::frame, FRAME_EVENT_MASK, get_visualid_by_depth(), con_state::id, con_state::initial, con_state::mapped, root, root_depth, root_screen, scalloc(), state, and XCURSOR_CURSOR_POINTER.

Referenced by con_new(), and json_end_map().

Here is the call graph for this function:

void x_con_kill ( Con con)

Kills the window decoration associated with the given container.

Definition at line 223 of file x.c.

References CIRCLEQ_REMOVE, conn, focused_id, Con::frame, FREE, con_state::name, Con::pixmap, Con::pm_gc, and state.

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 573 of file x.c.

References conn, Con::frame, Rect::height, con_state::mapped, Con::mapped, Con::pixmap, Con::pm_gc, Con::rect, state, TAILQ_EMPTY, TAILQ_FOREACH, Con::type, Rect::width, x_deco_recurse(), and x_draw_decoration().

Referenced by load_configuration(), x_deco_recurse(), and x_push_node().

Here is the call graph for this function:

void x_draw_decoration ( Con con)
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 1107 of file x.c.

References CIRCLEQ_FOREACH_REVERSE, conn, FRAME_EVENT_MASK, con_state::id, con_state::mapped, and state.

Referenced by resize_graphical_handler().

void x_move_win ( Con src,
Con dest 
)

Moves a child window from Container src to Container dest.

Definition at line 196 of file x.c.

References con_state::con, DLOG, ELOG, Con::frame, and con_state::window_rect.

Referenced by workspace_reassign_sticky().

void x_push_changes ( Con con)
void x_push_node ( Con con)
void x_raise_con ( Con con,
bool  above_all 
)

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.

If above_all is true, the X11 window will be raised to the top of the stack. This should only be used for precisely one fullscreen window per output.

Definition at line 1037 of file x.c.

References con_state::above_all, CIRCLEQ_INSERT_HEAD, CIRCLEQ_REMOVE, Con::frame, and state.

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 161 of file x.c.

References con_state::child_mapped, con_state::con, DLOG, ELOG, Con::frame, con_state::initial, state, and con_state::window_rect.

Referenced by manage_window().

void x_reparent_child ( Con con,
Con old 
)

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 181 of file x.c.

References ELOG, Con::frame, con_state::need_reparent, con_state::old_frame, and state.

Referenced by workspace_reassign_sticky().

void x_set_i3_atoms ( void  )

Sets up i3 specific atoms (I3_SOCKET_PATH and I3_CONFIG_PATH)

Definition at line 1080 of file x.c.

References conn, current_configpath, current_socketpath, root, update_shmlog_atom(), and XCB_ATOM_CARDINAL.

Referenced by cmd_reload(), and main().

Here is the call graph for this function:

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 1054 of file x.c.

References ELOG, Con::frame, FREE, con_state::name, sstrdup(), and state.

Referenced by _create___i3(), create_workspace_on_output(), floating_enable(), manage_window(), output_init_con(), and workspace_get().

Here is the call graph for this function:

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 1096 of file x.c.

References con_state::rect.

Referenced by _tree_next(), _workspace_show(), con_move_to_workspace(), and DRAGGING_CB().

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 266 of file x.c.

References conn, KILL_WINDOW, LOG, scalloc(), and window_supports_protocol().

Referenced by tree_close().

Here is the call graph for this function:

Variable Documentation

xcb_window_t focused_id

Stores the X11 window ID of the currently focused window.

Definition at line 16 of file x.c.

Referenced by handle_enter_notify(), handle_focus_in(), route_click(), and x_con_kill().