21 if (parent_a == parent_b) {
24 parent_b = parent_b->
parent;
26 parent_a = parent_a->
parent;
37 while (child && child->
parent != ancestor) {
50 while (current != ancestor) {
77 ELOG(
"Container is being inserted into one of its descendants.\n");
87 if (con_ancestor == target_ancestor) {
90 focus_before = moves_focus_from_ancestor;
95 if (current == con_ancestor || current == target_ancestor) {
99 focus_before = (current == con_ancestor);
108 if (moves_focus_from_ancestor && focus_before) {
123 if (parent->
type == CT_WORKSPACE) {
125 if (split != parent) {
126 DLOG(
"Got a new split con, using that one instead\n");
133 DLOG(
"ok, continuing with con %p instead\n", con);
160 }
else if (position ==
AFTER) {
170 CALL(old_parent, on_remove_child);
198 CALL(old_parent, on_remove_child);
211 DLOG(
"No output in this direction found. Not moving.\n");
219 DLOG(
"No workspace on output in this direction found. Not moving.\n");
224 const bool moves_focus = (
focused == con);
263 DLOG(
"Moving in direction %d\n", direction);
267 if (con->
type == CT_WORKSPACE) {
268 DLOG(
"Not moving workspace\n");
273 DLOG(
"Not moving fullscreen global container\n");
292 if (!same_orientation) {
300 DLOG(
"Inside floating, moving to workspace\n");
304 DLOG(
"Force-changing orientation\n");
310 if (same_orientation == con->
parent) {
316 DLOG(
"Moving into our bordering branch\n");
327 DLOG(
"Swapping with sibling.\n");
328 if (direction ==
D_LEFT || direction ==
D_UP) {
352 }
while (same_orientation == NULL);
358 while (above->
parent != same_orientation) {
364 LOG(
"Cannot move out of fullscreen container\n");
368 DLOG(
"above = %p\n", above);
373 DLOG(
"Moving into the bordering branch of our adjacent container\n");
388 DLOG(
"Grandparent is workspace\n");
392 DLOG(
"Moving into container above\n");
bool con_is_floating(Con *con)
Returns true if the node is floating.
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
Con * con_descend_direction(Con *con, direction_t direction)
Returns the leftmost, rightmost, etc.
Con * con_get_workspace(Con *con)
Gets the workspace container this node is on.
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...
void con_detach(Con *con)
Detaches the given container from its current parent.
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.
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.
Con * con_parent_with_orientation(Con *con, orientation_t orientation)
Searches parents of the given 'con' until it reaches one with the specified 'orientation'.
void con_focus(Con *con)
Sets input focus to the given container.
void ewmh_update_wm_desktop(void)
Updates _NET_WM_DESKTOP for all windows.
void floating_disable(Con *con)
Disables floating mode for the given container by re-attaching the container to its old parent.
static bool is_focused_descendant(Con *con, Con *ancestor)
static void attach_to_workspace(Con *con, Con *ws, direction_t direction)
void insert_con_into(Con *con, Con *target, position_t position)
This function detaches 'con' from its parent and inserts it either before or after 'target'.
void tree_move(Con *con, direction_t direction)
Moves the given container in the given direction.
static Con * child_containing_con_recursively(Con *ancestor, Con *con)
static void move_to_output_directed(Con *con, direction_t direction)
static Con * lowest_common_ancestor(Con *a, Con *b)
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.
Output * get_output_next(direction_t direction, Output *current, output_close_far_t close_far)
Gets the output which is the next one in the given direction.
void tree_flatten(Con *con)
tree_flatten() removes pairs of redundant split containers, e.g.: [workspace, horizontal] [v-split] [...
orientation_t orientation_from_direction(direction_t direction)
Convert a direction to its corresponding orientation.
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 ...
void ws_force_orientation(Con *ws, orientation_t orientation)
'Forces' workspace orientation by moving all cons into a new split-con with the same orientation as t...
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,...
#define TAILQ_FOREACH(var, head, field)
#define TAILQ_SWAP(first, second, head, field)
#define TAILQ_INSERT_TAIL(head, elm, field)
#define TAILQ_PREV(elm, headname, field)
#define TAILQ_FIRST(head)
#define TAILQ_REMOVE(head, elm, field)
#define TAILQ_NEXT(elm, field)
#define TAILQ_INSERT_BEFORE(listelm, elm, field)
#define TAILQ_INSERT_HEAD(head, elm, field)
#define TAILQ_INSERT_AFTER(head, listelm, elm, field)
#define CALL(obj, member,...)
#define GREP_FIRST(dest, head, condition)
An Output is a physical output on your graphics driver.
Con * con
Pointer to the Con which represents this output.
A 'Con' represents everything from the X11 root window down to a single X11 window.
struct deco_render_params * deco_render_params
Cache for the decoration rendering.
fullscreen_mode_t fullscreen_mode