24 while (parent != NULL && parent->
type != CT_WORKSPACE && parent->
type != CT_DOCKAREA) {
45 new->current_border_width = -1;
46 new->window_icon_padding = -1;
48 new->depth = window->
depth;
52 DLOG(
"opening window\n");
96 DLOG(
"con %p freed\n", con);
103 Con *current = previous;
104 struct nodes_head *nodes_head = &(parent->nodes_head);
105 struct focus_head *focus_head = &(parent->focus_head);
109 if (con->
type == CT_WORKSPACE) {
110 DLOG(
"it's a workspace. num = %d\n", con->
num);
115 if (con->
num < current->
num) {
119 while (current->
num != -1 && con->
num >= current->
num) {
134 goto add_to_focus_head;
137 if (parent->
type == CT_DOCKAREA) {
158 goto add_to_focus_head;
161 if (con->
type == CT_FLOATING_CON) {
162 DLOG(
"Inserting into floating containers\n");
168 if (loop->
type == CT_FLOATING_CON) {
183 if (con->
window != NULL &&
184 parent->
type == CT_WORKSPACE &&
186 DLOG(
"Parent is a workspace. Applying default layout...\n");
190 nodes_head = &(target->nodes_head);
191 focus_head = &(target->focus_head);
200 if (current != NULL && parent->
type != CT_OUTPUT) {
201 DLOG(
"Inserting con = %p after con %p\n", con, current);
236 if (con->
type == CT_FLOATING_CON) {
252 DLOG(
"con_focus = %p\n", con);
307 if (fullscreen_on_ws && fullscreen_on_ws != con && !
con_has_parent(con, fullscreen_on_ws)) {
338 DLOG(
"Closing con = %p.\n", con);
341 if (con->
type == CT_OUTPUT || con->
type == CT_ROOT) {
342 DLOG(
"con = %p is of type %d, not closing anything.\n", con, con->
type);
346 if (con->
type == CT_WORKSPACE) {
347 DLOG(
"con = %p is a workspace, closing all children instead.\n", con);
348 Con *child, *nextchild;
349 for (child =
TAILQ_FIRST(&(con->focus_head)); child;) {
351 DLOG(
"killing child = %p.\n", child);
415 while (current != NULL && current->
type != CT_WORKSPACE) {
418 if (
TAILQ_FIRST(&(parent->focus_head)) != current) {
451 switch (orientation) {
466 if (parent == NULL || current->
type == CT_WORKSPACE) {
480 if (parent->
type == CT_FLOATING_CON) {
514 if (con->
type == CT_WORKSPACE) {
519 DLOG(
"container %p does not accept windows, it is a split container.\n", con);
524 return (con->
window == NULL);
534 while (result != NULL && result->
type != CT_OUTPUT) {
539 assert(result != NULL);
549 while (result != NULL && result->
type != CT_WORKSPACE) {
561 DLOG(
"Searching for parent of Con %p with orientation %d\n", con, orientation);
563 if (parent->
type == CT_FLOATING_CON) {
567 DLOG(
"Need to go one level further up\n");
571 (parent->
type == CT_FLOATING_CON ||
572 parent->
type == CT_OUTPUT ||
576 if (parent == NULL) {
580 DLOG(
"Result: %p\n", parent);
600 Con *current, *child;
611 current = entry->
con;
631 TAILQ_FOREACH (child, &(current->floating_head), floating_windows) {
701 if (
con->
type == CT_FLOATING_CON) {
736 if (current == NULL) {
740 if (current == parent) {
770 if (
con == (
Con *)target) {
825 Con *transient_con = start;
827 while (transient_con != NULL &&
828 transient_con->
window != NULL &&
830 DLOG(
"transient_con = 0x%08x, transient_con->window->transient_for = 0x%08x, target = 0x%08x\n",
836 if (next_transient == NULL) {
841 if (transient_con == next_transient) {
844 transient_con = next_transient;
860 if (strcmp(current->
name, mark) == 0) {
876 DLOG(
"Toggling mark \"%s\" on con = %p.\n", mark,
con);
891 DLOG(
"Setting mark \"%s\" on con = %p.\n", mark,
con);
895 DLOG(
"Removing all existing marks on con = %p.\n",
con);
922 DLOG(
"Unmarking all containers.\n");
924 if (
con != NULL && current !=
con) {
945 DLOG(
"Removing mark \"%s\".\n", name);
947 if (current == NULL) {
948 DLOG(
"No container found with this mark, so there is nothing to do.\n");
952 DLOG(
"Found mark on con = %p. Removing it now.\n", current);
957 if (strcmp(mark->
name, name) != 0) {
985 if (store_match != NULL) {
986 *store_match = match;
991 if (result != NULL) {
1001 if (store_match != NULL) {
1002 *store_match = match;
1007 if (result != NULL) {
1016 int focus_heads = 0;
1037 assert(idx < focus_heads);
1038 focus_order[idx++] = current;
1052 int focus_heads = 0;
1060 for (
int idx = 0; idx < focus_heads; idx++) {
1097 Con *current = NULL;
1126 Con *current = NULL;
1151 int children_with_percent = 0;
1155 ++children_with_percent;
1161 if (children_with_percent != children) {
1164 if (children_with_percent == 0) {
1165 total += (child->
percent = 1.0);
1167 total += (child->
percent = total / children_with_percent);
1177 child->
percent = 1.0 / children;
1179 }
else if (total != 1.0) {
1193 if (
con->
type == CT_WORKSPACE) {
1194 DLOG(
"You cannot make a workspace fullscreen.\n");
1229 DLOG(
"Setting _NET_WM_STATE_FULLSCREEN for con = %p / window = %d.\n",
con,
con->
window->
id);
1232 DLOG(
"Removing _NET_WM_STATE_FULLSCREEN for con = %p / window = %d.\n",
con,
con->
window->
id);
1249 if (
con->
type == CT_WORKSPACE) {
1250 DLOG(
"You cannot make a workspace fullscreen.\n");
1257 DLOG(
"enabling global fullscreen for %p / %s\n",
con,
con->
name);
1263 DLOG(
"fullscreen already enabled for %p / %s\n",
con,
con->
name);
1271 if (fullscreen == NULL) {
1274 if (fullscreen != NULL) {
1283 if (fullscreen_mode ==
CF_GLOBAL && cur_ws != con_ws) {
1287 if (fullscreen_mode !=
CF_GLOBAL && cur_ws != con_ws) {
1300 if (
con->
type == CT_WORKSPACE) {
1301 DLOG(
"You cannot make a workspace fullscreen.\n");
1308 DLOG(
"fullscreen already disabled for %p / %s\n",
con,
con->
name);
1315static bool _con_move_to_con(
Con *
con,
Con *target,
bool behind_focused,
bool fix_coordinates,
bool dont_warp,
bool ignore_focus,
bool fix_percentage) {
1316 Con *orig_target = target;
1321 LOG(
"Cannot move out of a fullscreen container.\n");
1326 DLOG(
"Container is floating, using parent instead.\n");
1332 if (
con->
type == CT_WORKSPACE) {
1335 while (!
TAILQ_EMPTY(&(source_ws->floating_head))) {
1347 ELOG(
"Workspace failed to move its contents into a container!\n");
1364 Con *focus_next = NULL;
1365 if (!ignore_focus && source_ws == current_ws && target_ws != source_ws) {
1373 if (target->
type != CT_WORKSPACE) {
1374 DLOG(
"target originally = %p / %s / type %d\n", target, target->
name, target->
type);
1381 if (target->
type == CT_FLOATING_CON) {
1382 DLOG(
"floatingcon, going up even further\n");
1383 orig_target = target;
1387 if (
con->
type == CT_FLOATING_CON) {
1389 DLOG(
"This is a floating window, using workspace %p / %s\n", ws, ws->
name);
1393 if (source_output != dest_output) {
1396 if (fix_coordinates &&
con->
type == CT_FLOATING_CON) {
1399 DLOG(
"Not fixing coordinates, fix_coordinates flag = %d\n", fix_coordinates);
1414 if (con_has_fullscreen && fullscreen != NULL) {
1419 DLOG(
"Re-attaching container to %p / %s\n", target, target->
name);
1423 _con_attach(
con, target, behind_focused ? NULL : orig_target, !behind_focused);
1426 if (fix_percentage) {
1446 if (old_focus_ws == current_ws && old_focus->
type != CT_WORKSPACE) {
1457 if (!ignore_focus) {
1460 DLOG(
"x_set_warp_to(NULL) because dont_warp is set\n");
1496 CALL(parent, on_remove_child);
1506 DLOG(
"target container is in the scratchpad, moving container to scratchpad.\n");
1513 DLOG(
"target container is floating, moving container to target's workspace.\n");
1519 DLOG(
"target container is an empty workspace, simply moving the container there.\n");
1528 DLOG(
"target is a split container, descending to the currently focused child.\n");
1533 DLOG(
"cannot move the container to or inside itself, aborting.\n");
1546 if (target == NULL) {
1547 DLOG(
"found no container with mark \"%s\"\n", mark);
1575 assert(workspace->
type == CT_WORKSPACE);
1578 if (workspace == source_ws) {
1579 DLOG(
"Not moving, already there\n");
1610 if (output == NULL) {
1611 ELOG(
"Could not find output \"%s\"\n", name);
1638 ELOG(
"Someone called con_orientation() on a con with L_DEFAULT, this is a bug in the code.\n");
1643 ELOG(
"con_orientation() called on dockarea/output (%d) container %p\n",
con->
layout,
con);
1659 DLOG(
"selecting workspace for dock client\n");
1670 DLOG(
"Using first entry %p\n", next);
1724 if (child->
type == CT_FLOATING_CON) {
1731 }
while (before != next && next !=
focused);
1746 DLOG(
"con_descend_direction(%p, orientation %d, direction %d)\n",
con, orientation, direction);
1748 if (orientation ==
HORIZ) {
1756 }
else if (orientation ==
VERT) {
1761 if (current->
type != CT_FLOATING_CON) {
1773 if (direction ==
D_UP || direction ==
D_DOWN) {
1774 if (orientation ==
VERT) {
1777 if (direction ==
D_UP) {
1782 }
else if (orientation ==
HORIZ) {
1787 if (current->
type != CT_FLOATING_CON) {
1806 return gaps.
top > 0 ||
1830 return (
Rect){0, 0, 0, 0};
1845 DLOG(
"Effective border width is set to: %d\n", border_width);
1848 if (border_style ==
BS_NONE) {
1849 return (
Rect){0, 0, 0, 0};
1852 result = (
Rect){border_width, 0, -(2 * border_width), -(border_width)};
1854 result = (
Rect){border_width, border_width, -(2 * border_width), -(2 * border_width)};
1865 result.
x -= border_width;
1866 result.
width += border_width;
1869 result.
width += border_width;
1872 result.
y -= border_width;
1873 result.
height += border_width;
1876 result.
height += border_width;
1892 result.
y += deco_height;
1893 result.
height -= deco_height;
1938 DLOG(
"this one is fullscreen! overriding BS_NONE\n");
2003 DLOG(
"con_set_layout(%p, %d), con->type = %d\n",
2009 if (
con->
type != CT_WORKSPACE) {
2024 if (
con->
type == CT_WORKSPACE) {
2027 DLOG(
"Setting workspace_layout to %d\n", ws_layout);
2029 DLOG(
"Setting layout to %d\n", layout);
2032 DLOG(
"Creating new split container\n");
2045 DLOG(
"Moving cons\n");
2057 DLOG(
"Attaching new split to ws\n");
2120 if (
con->
type != CT_WORKSPACE) {
2123 DLOG(
"con_toggle_layout(%p, %s), parent = %p\n",
con, toggle_mode, parent);
2125 const char delim[] =
" ";
2127 if (strcasecmp(toggle_mode,
"split") == 0 || strstr(toggle_mode, delim)) {
2131 bool current_layout_found =
false;
2132 char *tm_dup =
sstrdup(toggle_mode);
2133 char *cur_tok = strtok(tm_dup, delim);
2135 for (
layout_t layout; cur_tok != NULL; cur_tok = strtok(NULL, delim)) {
2136 if (strcasecmp(cur_tok,
"split") == 0) {
2152 ELOG(
"The token '%s' was not recognized and has been skipped.\n", cur_tok);
2160 new_layout = layout;
2165 if (current_layout_found) {
2166 new_layout = layout;
2170 if (parent->
layout == layout) {
2171 current_layout_found =
true;
2179 }
else if (strcasecmp(toggle_mode,
"all") == 0 || strcasecmp(toggle_mode,
"default") == 0) {
2183 if (strcasecmp(toggle_mode,
"all") == 0) {
2189 if (strcasecmp(toggle_mode,
"all") == 0) {
2212 DLOG(
"on_remove_child\n");
2225 if (
con->
type == CT_WORKSPACE) {
2227 LOG(
"Closing old workspace (%p / %s), it is empty\n",
con,
con->
name);
2231 const unsigned char *payload;
2233 y(get_buf, &payload, &length);
2234 ipc_send_event(
"workspace", I3_IPC_EVENT_WORKSPACE, (
const char *)payload);
2248 if (children == 0) {
2249 DLOG(
"Container empty, closing\n");
2261 DLOG(
"Determining minimum size for con %p\n",
con);
2264 DLOG(
"leaf node, returning 75x50\n");
2265 return (
Rect){0, 0, 75, 50};
2268 if (
con->
type == CT_FLOATING_CON) {
2269 DLOG(
"floating con\n");
2275 uint32_t max_width = 0, max_height = 0, deco_height = 0;
2280 max_width =
max(max_width,
min.width);
2281 max_height =
max(max_height,
min.height);
2283 DLOG(
"stacked/tabbed now, returning %d x %d + deco_rect = %d\n",
2284 max_width, max_height, deco_height);
2285 return (
Rect){0, 0, max_width, max_height + deco_height};
2292 uint32_t width = 0, height = 0;
2298 height =
max(height,
min.height);
2300 height +=
min.height;
2301 width =
max(width,
min.width);
2304 DLOG(
"split container, returning width = %d x height = %d\n", width, height);
2305 return (
Rect){0, 0, width, height};
2308 ELOG(
"Unhandled case, type = %d, layout = %d, split = %d\n",
2352 if (fs->
type == CT_WORKSPACE) {
2408 if (
con->
type == CT_WORKSPACE) {
2413 while (parent && parent->
type != CT_WORKSPACE && parent->
type != CT_DOCKAREA) {
2414 if (new_urgency_value) {
2433 DLOG(
"Ignoring urgency flag for current client\n");
2442 DLOG(
"Discarding urgency WM_HINT because timer is running\n");
2509 ELOG(
"BUG: Code not updated to account for new layout type\n");
2520 (
TAILQ_FIRST(&(
con->nodes_head)) == child ?
"" :
" "), child_txt);
2531 return complete_buf;
2554 instance =
sstrdup(
"i3-frame");
2564 {.name =
"%title", .value = title},
2565 {.name =
"%class", .value =
class},
2566 {.name =
"%instance", .value = instance},
2567 {.name =
"%machine", .value = machine},
2569 const size_t num =
sizeof(placeholders) /
sizeof(
placeholder_t);
2575 free(formatted_str);
2588 assert(first != NULL);
2589 assert(second != NULL);
2590 DLOG(
"Swapping containers %p / %p\n", first, second);
2592 if (first->
type != CT_CON) {
2593 ELOG(
"Only regular containers can be swapped, but found con = %p with type = %d.\n", first, first->
type);
2597 if (second->
type != CT_CON) {
2598 ELOG(
"Only regular containers can be swapped, but found con = %p with type = %d.\n", second, second->
type);
2602 if (first == second) {
2603 DLOG(
"Swapping container %p with itself, nothing to do.\n", first);
2608 ELOG(
"Cannot swap containers %p and %p because they are in a parent-child relationship.\n", first, second);
2614 Con *restore_focus = NULL;
2619 restore_focus = second;
2621 restore_focus = first;
2624#define SWAP_CONS_IN_TREE(headname, field) \
2626 struct headname *head1 = &(first->parent->headname); \
2627 struct headname *head2 = &(second->parent->headname); \
2628 Con *first_prev = TAILQ_PREV(first, headname, field); \
2629 Con *second_prev = TAILQ_PREV(second, headname, field); \
2630 if (second_prev == first) { \
2631 TAILQ_SWAP(first, second, head1, field); \
2632 } else if (first_prev == second) { \
2633 TAILQ_SWAP(second, first, head1, field); \
2635 TAILQ_REMOVE(head1, first, field); \
2636 TAILQ_REMOVE(head2, second, field); \
2637 if (second_prev == NULL) { \
2638 TAILQ_INSERT_HEAD(head2, first, field); \
2640 TAILQ_INSERT_AFTER(head2, second_prev, first, field); \
2642 if (first_prev == NULL) { \
2643 TAILQ_INSERT_HEAD(head1, second, field); \
2645 TAILQ_INSERT_AFTER(head1, first_prev, second, field); \
2666 if (restore_focus) {
2682 if (second_fullscreen_mode ==
CF_NONE) {
2718 new->window = old->
window;
2722 FREE(new->title_format);
2728 FREE(new->sticky_group);
2733 new->sticky = old->
sticky;
2742 new->mark_changed = (
TAILQ_FIRST(&(old->marks_head)) != NULL);
2753 if (con->
parent == NULL) {
char * con_get_tree_representation(Con *con)
Create a string representing the subtree under con.
void con_move_to_workspace(Con *con, Con *workspace, bool fix_coordinates, bool dont_warp, bool ignore_focus)
Moves the given container to the currently focused container on the given workspace.
bool con_move_to_target(Con *con, Con *target)
bool con_move_to_mark(Con *con, const char *mark)
Moves the given container to the given mark.
bool con_move_to_output_name(Con *con, const char *name, bool fix_coordinates)
Moves the given container to the currently focused container on the visible workspace on the output s...
Con * con_get_fullscreen_con(Con *con, fullscreen_mode_t fullscreen_mode)
Returns the first fullscreen node below this node.
void con_set_urgency(Con *con, bool urgent)
Set urgency flag to the container, all the parent containers and the workspace.
bool con_is_floating(Con *con)
Returns true if the node is floating.
bool con_inside_stacked_or_tabbed(Con *con)
Returns true if the container is within any stacked/tabbed split container.
Con * con_for_window(Con *con, i3Window *window, Match **store_match)
Returns the first container below 'con' which wants to swallow this window TODO: priority.
void con_close(Con *con, kill_window_t kill_window)
Closes the given container.
static void con_raise(Con *con)
orientation_t con_orientation(Con *con)
Returns the orientation of the given container (for stacked containers, vertical orientation is used ...
void con_force_split_parents_redraw(Con *con)
force parent split containers to be redrawn
void con_unmark(Con *con, const char *name)
Removes marks from containers.
bool con_has_managed_window(Con *con)
Returns true when this con is a leaf node with a managed X11 window (e.g., excluding dock containers)
Con * con_descend_direction(Con *con, direction_t direction)
Returns the leftmost, rightmost, etc.
void con_update_parents_urgency(Con *con)
Make all parent containers urgent if con is urgent or clear the urgent flag of all parent containers ...
Con * con_new(Con *parent, i3Window *window)
A wrapper for con_new_skeleton, to retain the old con_new behaviour.
bool con_is_hidden(Con *con)
This will only return true for containers which have some parent with a tabbed / stacked parent of wh...
Con * con_get_workspace(Con *con)
Gets the workspace container this node is on.
bool con_find_transient_for_window(Con *start, xcb_window_t target)
Start from a container and traverse the transient_for linked list.
bool con_is_split(Con *con)
Returns true if a container should be considered split.
bool con_has_children(Con *con)
Returns true if this node has regular or floating children.
bool con_is_maximized(Con *con, orientation_t orientation)
Returns true if the container is maximized in the given orientation.
static Rect con_border_style_rect_without_title(Con *con)
Con * con_descend_tiling_focused(Con *con)
Returns the focused con inside this client, descending the tree as far as possible.
void con_disable_fullscreen(Con *con)
Disables fullscreen mode for the given container, if necessary.
static int num_focus_heads(Con *con)
bool con_is_docked(Con *con)
Returns true if the container is a docked container.
void con_set_border_style(Con *con, border_style_t border_style, int border_width)
Sets the given border style on con, correctly keeping the position/size of a floating window.
int con_num_visible_children(Con *con)
Returns the number of visible non-floating children of this container.
Con * con_by_con_id(long target)
Returns the container with the given container ID or NULL if no such container exists.
Con * con_new_skeleton(Con *parent, i3Window *window)
Create a new container (and attach it to the given parent, if not NULL).
void con_mark(Con *con, const char *mark, mark_mode_t mode)
Assigns a mark to the container.
Con * con_by_window_id(xcb_window_t window)
Returns the container with the given client window ID or NULL if no such container exists.
void con_activate_unblock(Con *con)
Activates the container like in con_activate but removes fullscreen restrictions and properly warps t...
Con * con_by_mark(const char *mark)
Returns the container with the given mark or NULL if no such container exists.
static void con_on_remove_child(Con *con)
Rect con_border_style_rect(Con *con)
Returns a "relative" Rect which contains the amount of pixels that need to be added to the original R...
Con * con_get_fullscreen_covering_ws(Con *ws)
Returns the fullscreen node that covers the given workspace if it exists.
void con_mark_toggle(Con *con, const char *mark, mark_mode_t mode)
Toggles the mark on a container.
Con * con_inside_floating(Con *con)
Checks if the given container is either floating or inside some floating container.
bool con_fullscreen_permits_focusing(Con *con)
Returns true if changing the focus to con would be allowed considering the fullscreen focus constrain...
bool con_swap(Con *first, Con *second)
Swaps the two containers.
bool con_accepts_window(Con *con)
Returns true if this node accepts a window (if the node swallows windows, it might already have swall...
uint32_t con_rect_size_in_orientation(Con *con)
Returns given container's rect size depending on its orientation.
bool con_is_internal(Con *con)
Returns true if the container is internal, such as __i3_scratch.
bool con_exists(Con *con)
Returns true if the given container (still) exists.
void con_detach(Con *con)
Detaches the given container from its current parent.
void con_move_to_output(Con *con, Output *output, bool fix_coordinates)
Moves the given container to the currently focused container on the visible workspace on the given ou...
void set_focus_order(Con *con, Con **focus_order)
Clear the container's focus stack and re-add it using the provided container array.
int con_border_style(Con *con)
Use this function to get a container’s border style.
void con_toggle_fullscreen(Con *con, int fullscreen_mode)
Toggles fullscreen mode for the given container.
void con_fix_percent(Con *con)
Updates the percent attribute of the children of the given container.
void con_attach(Con *con, Con *parent, bool ignore_focus)
Attaches the given container to the given parent.
Rect con_minimum_size(Con *con)
Determines the minimum size of the given con by looking at its children (for split/stacked/tabbed con...
i3String * con_parse_title_format(Con *con)
Returns the window title considering the current title format.
static void _con_attach(Con *con, Con *parent, Con *previous, bool ignore_focus)
static bool has_outer_gaps(gaps_t gaps)
bool con_inside_focused(Con *con)
Checks if the given container is inside a focused container.
#define SWAP_CONS_IN_TREE(headname, field)
void con_free(Con *con)
Frees the specified container.
static bool _con_move_to_con(Con *con, Con *target, bool behind_focused, bool fix_coordinates, bool dont_warp, bool ignore_focus, bool fix_percentage)
void con_merge_into(Con *old, Con *new)
Merges container specific data that should move with the window (e.g.
Con * con_by_frame_id(xcb_window_t frame)
Returns the container with the given frame ID or NULL if no such container exists.
bool con_is_leaf(Con *con)
Returns true when this node is a leaf node (has no children)
int con_num_children(Con *con)
Returns the number of children of this container.
adjacent_t con_adjacent_borders(Con *con)
Returns adjacent borders of the window.
void con_set_layout(Con *con, layout_t layout)
This function changes the layout of a given container.
void con_activate(Con *con)
Sets input focus to the given container and raises it to the top.
Con * con_parent_with_orientation(Con *con, orientation_t orientation)
Searches parents of the given 'con' until it reaches one with the specified 'orientation'.
bool con_draw_decoration_into_frame(Con *con)
Returns whether the window decoration (title bar) should be drawn into the X11 frame window of this c...
void con_toggle_layout(Con *con, const char *toggle_mode)
This function toggles the layout of a given container.
bool con_has_mark(Con *con, const char *mark)
Returns true if and only if the given containers holds the mark.
Con * con_next_focused(Con *con)
Returns the container which will be focused next when the given container is not available anymore.
bool con_has_urgent_child(Con *con)
Checks if the given container has an urgent child.
void con_enable_fullscreen(Con *con, fullscreen_mode_t fullscreen_mode)
Enables fullscreen mode for the given container, if necessary.
bool con_has_parent(Con *con, Con *parent)
Checks if the container has the given parent as an actual parent.
int con_num_windows(Con *con)
Count the number of windows (i.e., leaf containers).
void con_focus(Con *con)
Sets input focus to the given container.
Con * con_get_output(Con *con)
Gets the output container (first container with CT_OUTPUT in hierarchy) this node is on.
Con * con_descend_focused(Con *con)
Returns the focused con inside this client, descending the tree as far as possible.
bool con_is_sticky(Con *con)
Returns whether the container or any of its children is sticky.
Con ** get_focus_order(Con *con)
Iterate over the container's focus stack and return an array with the containers inside it,...
static void con_set_fullscreen_mode(Con *con, fullscreen_mode_t fullscreen_mode)
void ewmh_update_wm_desktop(void)
Updates _NET_WM_DESKTOP for all windows.
void floating_raise_con(Con *con)
Raises the given container in the list of floating containers.
void floating_fix_coordinates(Con *con, Rect *old_rect, Rect *new_rect)
Fixes the coordinates of the floating window whenever the window gets reassigned to a different outpu...
gaps_t calculate_effective_gaps(Con *con)
Calculates the effective gap sizes for a container.
struct pending_marks * marks
void match_free(Match *match)
Frees the given match.
bool match_matches_window(Match *match, i3Window *window)
Check if a match data structure matches the given window.
Output * get_output_from_string(Output *current_output, const char *output_str)
Returns an 'output' corresponding to one of left/right/down/up or a specific output name.
char * output_primary_name(Output *output)
Retrieves the primary name of an output.
Output * get_output_for_con(Con *con)
Retrieves the output for a given container.
Con * output_get_content(Con *output)
Returns the output container below the given output container.
int render_deco_height(void)
Returns the height for the decorations.
void scratchpad_move(Con *con)
Moves the specified window to the __i3_scratch workspace, making it floating and setting the appropri...
void startup_sequence_delete_by_window(i3Window *win)
Deletes the startup sequence for a window if it exists.
void tree_flatten(Con *con)
tree_flatten() removes pairs of redundant split containers, e.g.: [workspace, horizontal] [v-split] [...
bool tree_close_internal(Con *con, kill_window_t kill_window, bool dont_kill_parent)
Closes the given container including all children.
struct all_cons_head all_cons
Rect rect_add(Rect a, Rect b)
char * pango_escape_markup(char *input)
Escapes the given string if a pango font is currently used.
bool layout_from_name(const char *layout_str, layout_t *out)
Set 'out' to the layout_t value for the given layout.
Rect rect_sub(Rect a, Rect b)
void workspace_update_urgent_flag(Con *ws)
Goes through all clients on the given workspace and updates the workspace’s urgent flag accordingly.
void workspace_show(Con *workspace)
Switches to the given workspace.
bool workspace_is_visible(Con *ws)
Returns true if the workspace is currently visible.
Con * workspace_attach_to(Con *ws)
Called when a new con (with a window, not an empty or split con) should be attached to the workspace ...
Con * workspace_get(const char *num)
Returns a pointer to the workspace with the given number (starting at 0), creating the workspace if n...
Con * workspace_encapsulate(Con *ws)
Creates a new container and re-parents all of children from the given workspace into it.
void x_con_init(Con *con)
Initializes the X11 part for the given container.
void x_set_warp_to(Rect *rect)
Set warp_to coordinates.
void xcb_add_property_atom(xcb_connection_t *conn, xcb_window_t window, xcb_atom_t property, xcb_atom_t atom)
Add an atom to a list of atoms the given property defines.
void xcb_remove_property_atom(xcb_connection_t *conn, xcb_window_t window, xcb_atom_t property, xcb_atom_t atom)
Remove an atom from a list of atoms the given property defines without removing any other potentially...
void ipc_send_event(const char *event, uint32_t message_type, const char *payload)
Sends the specified event to all IPC clients which are currently connected and subscribed to this kin...
yajl_gen ipc_marshal_workspace_event(const char *change, Con *current, Con *old)
Generates a json workspace event.
void ipc_send_window_event(const char *property, Con *con)
For the window events we send, along the usual "change" field, also the window container,...
xcb_connection_t * conn
XCB connection and root screen.
layout_t
Container layouts.
adjacent_t
describes if the window is adjacent to the output (physical screen) edges.
fullscreen_mode_t
Fullscreen modes.
kill_window_t
parameter to specify whether tree_close_internal() and x_window_kill() should kill only this specific...
struct _i3String i3String
Opaque data structure for storing strings.
int strcasecmp_nullable(const char *a, const char *b)
Like strcasecmp but considers the case where either string is NULL.
char * sstrdup(const char *str)
Safe-wrapper around strdup which exits if malloc returns NULL (meaning that there is no more memory a...
char * format_placeholders(char *format, placeholder_t *placeholders, int num)
Replaces occurrences of the defined placeholders in the format string.
const char * i3string_as_utf8(i3String *str)
Returns the UTF-8 encoded version of the i3String.
void * scalloc(size_t num, size_t size)
Safe-wrapper around calloc which exits if malloc returns NULL (meaning that there is no more memory a...
int sasprintf(char **strp, const char *fmt,...)
Safe-wrapper around asprintf which exits if it returns -1 (meaning that there is no more memory avail...
void i3string_set_markup(i3String *str, bool pango_markup)
Set whether the i3String should use Pango markup.
i3String * i3string_from_utf8(const char *from_utf8)
Build an i3String from an UTF-8 encoded string.
bool font_is_pango(void)
Returns true if and only if the current font is a pango font.
void * smalloc(size_t size)
Safe-wrapper around malloc which exits if malloc returns NULL (meaning that there is no more memory a...
#define TAILQ_FOREACH(var, head, field)
#define TAILQ_HEAD(name, type)
#define TAILQ_INSERT_TAIL(head, elm, field)
#define TAILQ_FIRST(head)
#define TAILQ_REMOVE(head, elm, field)
#define TAILQ_NEXT(elm, field)
#define TAILQ_HEAD_INITIALIZER(head)
#define TAILQ_EMPTY(head)
#define TAILQ_INSERT_BEFORE(listelm, elm, field)
#define TAILQ_LAST(head, headname)
#define TAILQ_INSERT_HEAD(head, elm, field)
#define TAILQ_ENTRY(type)
#define TAILQ_INSERT_AFTER(head, listelm, elm, field)
#define CALL(obj, member,...)
#define GREP_FIRST(dest, head, condition)
#define SWAP(first, second, type)
hide_edge_borders_mode_t hide_edge_borders
Remove borders if they are adjacent to the screen edge.
int default_floating_border_width
border_style_t default_border
The default border style for new windows.
Stores a rectangle, for example the size of a window, the child window etc.
An Output is a physical output on your graphics driver.
Con * con
Pointer to the Con which represents this output.
A 'Window' is a type which contains an xcb_window_t and all the related information (hints like _NET_...
struct timeval urgent
When this window was marked urgent.
i3String * name
The name of the window.
xcb_window_t transient_for
uint16_t depth
Depth of the window.
A "match" is a data structure which acts like a mask or expression to match certain windows or not.
A 'Con' represents everything from the X11 root window down to a single X11 window.
layout_t workspace_layout
layout_t last_split_layout
border_style_t max_user_border_style
int num
the workspace number, if this Con is of type CT_WORKSPACE and the workspace is not a named workspace ...
struct ev_timer * urgency_timer
char * title_format
The format with which the window's name should be displayed.
border_style_t border_style
struct deco_render_params * deco_render_params
Cache for the decoration rendering.
enum Con::@19 floating
floating? (= not in tiling layout) This cannot be simply a bool because we want to keep track of whet...
fullscreen_mode_t fullscreen_mode
Helper structure for usage in format_placeholders().