Go to the documentation of this file.
49 DLOG(
"Rendering node %p / %s / layout %d / children %d\n", con, con->
name,
53 if (!already_inset && should_inset) {
102 DLOG(
"child will be at %dx%d with size %dx%d\n", inset->
x, inset->
y, inset->
width, inset->
height);
106 Con *fullscreen = NULL;
107 if (con->
type != CT_OUTPUT) {
120 if (con->
type != CT_ROOT) {
136 }
else if (con->
type == CT_ROOT) {
153 DLOG(
"child at (%d, %d) with (%d x %d)\n",
156 render_con(child, should_inset || already_inset);
194 int i = 0, assigned = 0;
198 assigned += sizes[i++] = lround(percentage * total);
200 assert(assigned == total ||
201 (assigned > total && assigned - total <= p->children * 2) ||
202 (assigned < total && total - assigned <= p->children * 2));
203 int signal = assigned < total ? 1 : -1;
204 while (assigned != total) {
205 for (i = 0; i < p->
children && assigned != total; ++i) {
226 DLOG(
"Rendering floating windows:\n");
233 DLOG(
"Skipping this output because it is currently being destroyed.\n");
240 if (fullscreen != NULL) {
251 Con *transient_con = floating_child;
252 bool is_transient_for =
false;
253 while (transient_con != NULL &&
254 transient_con->
window != NULL &&
256 DLOG(
"transient_con = 0x%08x, transient_con->window->transient_for = 0x%08x, fullscreen_id = 0x%08x\n",
259 is_transient_for =
true;
263 if (next_transient == NULL)
268 if (transient_con == next_transient)
270 transient_con = next_transient;
273 if (!is_transient_for)
276 DLOG(
"Rendering floating child even though in fullscreen mode: "
277 "floating->transient_for (0x%08x) --> fullscreen->id (0x%08x)\n",
281 DLOG(
"floating child at (%d,%d) with %d x %d\n",
295 Con *child, *dockchild;
305 if (child->
type == CT_CON) {
306 if (content != NULL) {
307 DLOG(
"More than one CT_CON on output container\n");
311 }
else if (child->
type != CT_DOCKAREA) {
312 DLOG(
"Child %p of type %d is inside the OUTPUT con\n", child, child->
type);
317 if (content == NULL) {
318 DLOG(
"Skipping this output because it is currently being destroyed.\n");
327 DLOG(
"Skipping this output because it is currently being destroyed.\n");
341 if (child->
type != CT_DOCKAREA)
353 if (child->
type == CT_CON) {
371 DLOG(
"child at (%d, %d) with (%d x %d)\n",
482 if (con->
type == CT_FLOATING_CON || con->
type == CT_WORKSPACE)
499 if (fullscreen == NULL)
503 if (con == fullscreen)
513 if (fullscreen == NULL)
xcb_window_t transient_for
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.
static void render_con_stacked(Con *con, Con *child, render_params *p, int i)
Con * con_get_fullscreen_con(Con *con, fullscreen_mode_t fullscreen_mode)
Returns the first fullscreen node below this node.
bool should_inset_con(Con *con, int children)
gaps_t calculate_effective_gaps(Con *con)
Calculates the effective gap sizes for a container.
int height
The height of the font, built from font_ascent + font_descent.
bool con_is_leaf(Con *con)
Returns true when this node is a leaf node (has no children)
int render_deco_height(void)
Returns the height for the decorations.
static void render_output(Con *con)
bool con_has_parent(Con *con, Con *parent)
Checks if the container has the given parent as an actual parent.
#define TAILQ_EMPTY(head)
static void render_root(Con *con, Con *fullscreen)
Rect rect_add(Rect a, Rect b)
#define TAILQ_FOREACH_REVERSE(var, head, headname, field)
#define TAILQ_FIRST(head)
static void render_con_dockarea(Con *con, Con *child, render_params *p)
static int * precalculate_sizes(Con *con, render_params *p)
bool resize_find_tiling_participants(Con **current, Con **other, direction_t direction, bool both_sides)
uint32_t con_rect_size_in_orientation(Con *con)
Returns given container's rect size depending on its orientation.
static void render_con_tabbed(Con *con, Con *child, render_params *p, int i)
fullscreen_mode_t fullscreen_mode
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...
int con_num_children(Con *con)
Returns the number of children of this container.
This is used to keep a state to pass around when rendering a con in render_con().
bool con_is_internal(Con *con)
Returns true if the container is internal, such as __i3_scratch.
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)
border_style_t border_style
struct Rect geometry
the geometry this window requested when getting mapped
Con * con_descend_focused(Con *con)
Returns the focused con inside this client, descending the tree as far as possible.
A 'Con' represents everything from the X11 root window down to a single X11 window.
void render_con(Con *con, bool already_inset)
"Renders" the given container (and its children), meaning that all rects are updated correctly.
static void render_con_split(Con *con, Con *child, render_params *p, int i)
Con * con_get_fullscreen_covering_ws(Con *ws)
Returns the fullscreen node that covers the given workspace if it exists.
Con * con_get_workspace(Con *con)
Gets the workspace container this node is on.
Con * output_get_content(Con *output)
Returns the output container below the given output container.
void x_raise_con(Con *con)
Raises the specified container in the internal stack of X windows.
bool has_adjacent_container(Con *con, direction_t direction)
enum Config::@8 popup_during_fullscreen
What should happen when a new popup is opened during fullscreen mode.
Stores a rectangle, for example the size of a window, the child window etc.