i3
render.c
Go to the documentation of this file.
1 /*
2  * vim:ts=4:sw=4:expandtab
3  *
4  * i3 - an improved dynamic tiling window manager
5  * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
6  *
7  * render.c: Renders (determines position/sizes) the layout tree, updating the
8  * various rects. Needs to be pushed to X11 (see x.c) to be visible.
9  *
10  */
11 #include "all.h"
12 
13 #include <math.h>
14 
15 /* Forward declarations */
16 static int *precalculate_sizes(Con *con, render_params *p);
17 static void render_root(Con *con, Con *fullscreen);
18 static void render_output(Con *con);
19 static void render_con_split(Con *con, Con *child, render_params *p, int i);
20 static void render_con_stacked(Con *con, Con *child, render_params *p, int i);
21 static void render_con_tabbed(Con *con, Con *child, render_params *p, int i);
22 static void render_con_dockarea(Con *con, Con *child, render_params *p);
23 bool should_inset_con(Con *con, int children);
24 bool has_adjacent_container(Con *con, direction_t direction);
25 
26 /*
27  * Returns the height for the decorations
28  */
29 int render_deco_height(void) {
30  int deco_height = config.font.height + 4;
31  if (config.font.height & 0x01)
32  ++deco_height;
33  return deco_height;
34 }
35 
36 /*
37  * "Renders" the given container (and its children), meaning that all rects are
38  * updated correctly. Note that this function does not call any xcb_*
39  * functions, so the changes are completely done in memory only (and
40  * side-effect free). As soon as you call x_push_changes(), the changes will be
41  * updated in X11.
42  *
43  */
44 void render_con(Con *con, bool already_inset) {
45  render_params params = {
46  .rect = con->rect,
47  .x = con->rect.x,
48  .y = con->rect.y,
49  .children = con_num_children(con)};
50 
51  DLOG("Rendering node %p / %s / layout %d / children %d\n", con, con->name,
52  con->layout, params.children);
53 
54  bool should_inset = should_inset_con(con, params.children);
55  if (!already_inset && should_inset) {
56  gaps_t gaps = calculate_effective_gaps(con);
57  Rect inset = (Rect){
58  has_adjacent_container(con, D_LEFT) ? gaps.inner : gaps.left,
59  has_adjacent_container(con, D_UP) ? gaps.inner : gaps.top,
60  has_adjacent_container(con, D_RIGHT) ? -gaps.inner : -gaps.right,
61  has_adjacent_container(con, D_DOWN) ? -gaps.inner : -gaps.bottom};
62  inset.width -= inset.x;
63  inset.height -= inset.y;
64 
65  if (con->fullscreen_mode == CF_NONE) {
66  params.rect = rect_add(params.rect, inset);
67  con->rect = rect_add(con->rect, inset);
68  if (con->window) {
69  con->window_rect = rect_add(con->window_rect, inset);
70  }
71  }
72  inset.height = 0;
73  if (con->deco_rect.width != 0 && con->deco_rect.height != 0) {
74  con->deco_rect = rect_add(con->deco_rect, inset);
75  }
76 
77  params.x = con->rect.x;
78  params.y = con->rect.y;
79  }
80 
81  int i = 0;
82  con->mapped = true;
83 
84  /* if this container contains a window, set the coordinates */
85  if (con->window) {
86  /* depending on the border style, the rect of the child window
87  * needs to be smaller */
88  Rect *inset = &(con->window_rect);
89  *inset = (Rect){0, 0, con->rect.width, con->rect.height};
90  if (con->fullscreen_mode == CF_NONE) {
91  *inset = rect_add(*inset, con_border_style_rect(con));
92  }
93 
94  /* Obey x11 border */
95  inset->width -= (2 * con->border_width);
96  inset->height -= (2 * con->border_width);
97 
98  *inset = rect_sanitize_dimensions(*inset);
99 
100  /* NB: We used to respect resize increment size hints for tiling
101  * windows up until commit 0db93d9 here. However, since all terminal
102  * emulators cope with ignoring the size hints in a better way than we
103  * can (by providing their fake-transparency or background color), this
104  * code was removed. See also https://bugs.i3wm.org/540 */
105 
106  DLOG("child will be at %dx%d with size %dx%d\n", inset->x, inset->y, inset->width, inset->height);
107  }
108 
109  /* Check for fullscreen nodes */
110  Con *fullscreen = NULL;
111  if (con->type != CT_OUTPUT) {
112  fullscreen = con_get_fullscreen_con(con, (con->type == CT_ROOT ? CF_GLOBAL : CF_OUTPUT));
113  }
114  if (fullscreen) {
115  fullscreen->rect = params.rect;
116  x_raise_con(fullscreen);
117  render_con(fullscreen, false);
118  /* Fullscreen containers are either global (underneath the CT_ROOT
119  * container) or per-output (underneath the CT_CONTENT container). For
120  * global fullscreen containers, we cannot abort rendering here yet,
121  * because the floating windows (with popup_during_fullscreen smart)
122  * have not yet been rendered (see the CT_ROOT code path below). See
123  * also https://bugs.i3wm.org/1393 */
124  if (con->type != CT_ROOT) {
125  return;
126  }
127  }
128 
129  /* find the height for the decorations */
130  params.deco_height = render_deco_height();
131 
132  /* precalculate the sizes to be able to correct rounding errors */
133  params.sizes = precalculate_sizes(con, &params);
134 
135  if (con->layout == L_OUTPUT) {
136  /* Skip i3-internal outputs */
137  if (con_is_internal(con))
138  goto free_params;
139  render_output(con);
140  } else if (con->type == CT_ROOT) {
141  render_root(con, fullscreen);
142  } else {
143  Con *child;
144  TAILQ_FOREACH (child, &(con->nodes_head), nodes) {
145  assert(params.children > 0);
146 
147  if (con->layout == L_SPLITH || con->layout == L_SPLITV) {
148  render_con_split(con, child, &params, i);
149  } else if (con->layout == L_STACKED) {
150  render_con_stacked(con, child, &params, i);
151  } else if (con->layout == L_TABBED) {
152  render_con_tabbed(con, child, &params, i);
153  } else if (con->layout == L_DOCKAREA) {
154  render_con_dockarea(con, child, &params);
155  }
156 
157  child->rect = rect_sanitize_dimensions(child->rect);
158 
159  DLOG("child at (%d, %d) with (%d x %d)\n",
160  child->rect.x, child->rect.y, child->rect.width, child->rect.height);
161  x_raise_con(child);
162  render_con(child, should_inset || already_inset);
163  i++;
164  }
165 
166  /* in a stacking or tabbed container, we ensure the focused client is raised */
167  if (con->layout == L_STACKED || con->layout == L_TABBED) {
168  TAILQ_FOREACH_REVERSE (child, &(con->focus_head), focus_head, focused) {
169  x_raise_con(child);
170  }
171  if ((child = TAILQ_FIRST(&(con->focus_head)))) {
172  /* By rendering the stacked container again, we handle the case
173  * that we have a non-leaf-container inside the stack. In that
174  * case, the children of the non-leaf-container need to be
175  * raised as well. */
176  render_con(child, true);
177  }
178 
179  if (params.children != 1)
180  /* Raise the stack con itself. This will put the stack
181  * decoration on top of every stack window. That way, when a
182  * new window is opened in the stack, the old window will not
183  * obscure part of the decoration (it’s unmapped afterwards). */
184  x_raise_con(con);
185  }
186  }
187 
188 free_params:
189  FREE(params.sizes);
190 }
191 
192 static int *precalculate_sizes(Con *con, render_params *p) {
193  if ((con->layout != L_SPLITH && con->layout != L_SPLITV) || p->children <= 0) {
194  return NULL;
195  }
196 
197  int *sizes = smalloc(p->children * sizeof(int));
198  assert(!TAILQ_EMPTY(&con->nodes_head));
199 
200  Con *child;
201  int i = 0, assigned = 0;
202  int total = con_rect_size_in_orientation(con);
203  TAILQ_FOREACH (child, &(con->nodes_head), nodes) {
204  double percentage = child->percent > 0.0 ? child->percent : 1.0 / p->children;
205  assigned += sizes[i++] = lround(percentage * total);
206  }
207  assert(assigned == total ||
208  (assigned > total && assigned - total <= p->children * 2) ||
209  (assigned < total && total - assigned <= p->children * 2));
210  int signal = assigned < total ? 1 : -1;
211  while (assigned != total) {
212  for (i = 0; i < p->children && assigned != total; ++i) {
213  sizes[i] += signal;
214  assigned += signal;
215  }
216  }
217 
218  return sizes;
219 }
220 
221 static void render_root(Con *con, Con *fullscreen) {
222  Con *output;
223  if (!fullscreen) {
224  TAILQ_FOREACH (output, &(con->nodes_head), nodes) {
225  render_con(output, false);
226  }
227  }
228 
229  /* We need to render floating windows after rendering all outputs’
230  * tiling windows because they need to be on top of *every* output at
231  * all times. This is important when the user places floating
232  * windows/containers so that they overlap on another output. */
233  DLOG("Rendering floating windows:\n");
234  TAILQ_FOREACH (output, &(con->nodes_head), nodes) {
235  if (con_is_internal(output))
236  continue;
237  /* Get the active workspace of that output */
238  Con *content = output_get_content(output);
239  if (!content || TAILQ_EMPTY(&(content->focus_head))) {
240  DLOG("Skipping this output because it is currently being destroyed.\n");
241  continue;
242  }
243  Con *workspace = TAILQ_FIRST(&(content->focus_head));
244  Con *fullscreen = con_get_fullscreen_covering_ws(workspace);
245  Con *child;
246  TAILQ_FOREACH (child, &(workspace->floating_head), floating_windows) {
247  if (fullscreen != NULL) {
248  /* Don’t render floating windows when there is a fullscreen
249  * window on that workspace. Necessary to make floating
250  * fullscreen work correctly (ticket #564). Exception to the
251  * above rule: smart popup_during_fullscreen handling (popups
252  * belonging to the fullscreen app will be rendered). */
253  if (config.popup_during_fullscreen != PDF_SMART || fullscreen->window == NULL) {
254  continue;
255  }
256 
257  Con *floating_child = con_descend_focused(child);
258  Con *transient_con = floating_child;
259  bool is_transient_for = false;
260  while (transient_con != NULL &&
261  transient_con->window != NULL &&
262  transient_con->window->transient_for != XCB_NONE) {
263  DLOG("transient_con = 0x%08x, transient_con->window->transient_for = 0x%08x, fullscreen_id = 0x%08x\n",
264  transient_con->window->id, transient_con->window->transient_for, fullscreen->window->id);
265  if (transient_con->window->transient_for == fullscreen->window->id) {
266  is_transient_for = true;
267  break;
268  }
269  Con *next_transient = con_by_window_id(transient_con->window->transient_for);
270  if (next_transient == NULL)
271  break;
272  /* Some clients (e.g. x11-ssh-askpass) actually set
273  * WM_TRANSIENT_FOR to their own window id, so break instead of
274  * looping endlessly. */
275  if (transient_con == next_transient)
276  break;
277  transient_con = next_transient;
278  }
279 
280  if (!is_transient_for)
281  continue;
282  else {
283  DLOG("Rendering floating child even though in fullscreen mode: "
284  "floating->transient_for (0x%08x) --> fullscreen->id (0x%08x)\n",
285  floating_child->window->transient_for, fullscreen->window->id);
286  }
287  }
288  DLOG("floating child at (%d,%d) with %d x %d\n",
289  child->rect.x, child->rect.y, child->rect.width, child->rect.height);
290  x_raise_con(child);
291  render_con(child, true);
292  }
293  }
294 }
295 
296 /*
297  * Renders a container with layout L_OUTPUT. In this layout, all CT_DOCKAREAs
298  * get the height of their content and the remaining CT_CON gets the rest.
299  *
300  */
301 static void render_output(Con *con) {
302  Con *child, *dockchild;
303 
304  int x = con->rect.x;
305  int y = con->rect.y;
306  int height = con->rect.height;
307 
308  /* Find the content container and ensure that there is exactly one. Also
309  * check for any non-CT_DOCKAREA clients. */
310  Con *content = NULL;
311  TAILQ_FOREACH (child, &(con->nodes_head), nodes) {
312  if (child->type == CT_CON) {
313  if (content != NULL) {
314  DLOG("More than one CT_CON on output container\n");
315  assert(false);
316  }
317  content = child;
318  } else if (child->type != CT_DOCKAREA) {
319  DLOG("Child %p of type %d is inside the OUTPUT con\n", child, child->type);
320  assert(false);
321  }
322  }
323 
324  if (content == NULL) {
325  DLOG("Skipping this output because it is currently being destroyed.\n");
326  return;
327  }
328 
329  /* We need to find out if there is a fullscreen con on the current workspace
330  * and take the short-cut to render it directly (the user does not want to
331  * see the dockareas in that case) */
332  Con *ws = con_get_fullscreen_con(content, CF_OUTPUT);
333  if (!ws) {
334  DLOG("Skipping this output because it is currently being destroyed.\n");
335  return;
336  }
337  Con *fullscreen = con_get_fullscreen_con(ws, CF_OUTPUT);
338  if (fullscreen) {
339  fullscreen->rect = con->rect;
340  x_raise_con(fullscreen);
341  render_con(fullscreen, false);
342  return;
343  }
344 
345  /* First pass: determine the height of all CT_DOCKAREAs (the sum of their
346  * children) and figure out how many pixels we have left for the rest */
347  TAILQ_FOREACH (child, &(con->nodes_head), nodes) {
348  if (child->type != CT_DOCKAREA)
349  continue;
350 
351  child->rect.height = 0;
352  TAILQ_FOREACH (dockchild, &(child->nodes_head), nodes) {
353  child->rect.height += dockchild->geometry.height;
354  }
355 
356  height -= child->rect.height;
357  }
358 
359  /* Second pass: Set the widths/heights */
360  TAILQ_FOREACH (child, &(con->nodes_head), nodes) {
361  if (child->type == CT_CON) {
362  child->rect.x = x;
363  child->rect.y = y;
364  child->rect.width = con->rect.width;
365  child->rect.height = height;
366  }
367 
368  child->rect.x = x;
369  child->rect.y = y;
370  child->rect.width = con->rect.width;
371 
372  child->deco_rect.x = 0;
373  child->deco_rect.y = 0;
374  child->deco_rect.width = 0;
375  child->deco_rect.height = 0;
376 
377  y += child->rect.height;
378 
379  DLOG("child at (%d, %d) with (%d x %d)\n",
380  child->rect.x, child->rect.y, child->rect.width, child->rect.height);
381  x_raise_con(child);
382  render_con(child, child->type == CT_DOCKAREA);
383  }
384 }
385 
386 static void render_con_split(Con *con, Con *child, render_params *p, int i) {
387  assert(con->layout == L_SPLITH || con->layout == L_SPLITV);
388 
389  if (con->layout == L_SPLITH) {
390  child->rect.x = p->x;
391  child->rect.y = p->y;
392  child->rect.width = p->sizes[i];
393  child->rect.height = p->rect.height;
394  p->x += child->rect.width;
395  } else {
396  child->rect.x = p->x;
397  child->rect.y = p->y;
398  child->rect.width = p->rect.width;
399  child->rect.height = p->sizes[i];
400  p->y += child->rect.height;
401  }
402 
403  /* first we have the decoration, if this is a leaf node */
404  if (con_is_leaf(child)) {
405  if (child->border_style == BS_NORMAL) {
406  /* TODO: make a function for relative coords? */
407  child->deco_rect.x = child->rect.x - con->rect.x;
408  child->deco_rect.y = child->rect.y - con->rect.y;
409 
410  child->rect.y += p->deco_height;
411  child->rect.height -= p->deco_height;
412 
413  child->deco_rect.width = child->rect.width;
414  child->deco_rect.height = p->deco_height;
415  } else {
416  child->deco_rect.x = 0;
417  child->deco_rect.y = 0;
418  child->deco_rect.width = 0;
419  child->deco_rect.height = 0;
420  }
421  }
422 }
423 
424 static void render_con_stacked(Con *con, Con *child, render_params *p, int i) {
425  assert(con->layout == L_STACKED);
426 
427  child->rect.x = p->x;
428  child->rect.y = p->y;
429  child->rect.width = p->rect.width;
430  child->rect.height = p->rect.height;
431 
432  child->deco_rect.x = p->x - con->rect.x;
433  child->deco_rect.y = p->y - con->rect.y + (i * p->deco_height);
434  child->deco_rect.width = child->rect.width;
435  child->deco_rect.height = p->deco_height;
436 
437  if (p->children > 1 || (child->border_style != BS_PIXEL && child->border_style != BS_NONE)) {
438  child->rect.y += (p->deco_height * p->children);
439  child->rect.height -= (p->deco_height * p->children);
440  }
441 }
442 
443 static void render_con_tabbed(Con *con, Con *child, render_params *p, int i) {
444  assert(con->layout == L_TABBED);
445 
446  child->rect.x = p->x;
447  child->rect.y = p->y;
448  child->rect.width = p->rect.width;
449  child->rect.height = p->rect.height;
450 
451  child->deco_rect.width = floor((float)child->rect.width / p->children);
452  child->deco_rect.x = p->x - con->rect.x + i * child->deco_rect.width;
453  child->deco_rect.y = p->y - con->rect.y;
454 
455  /* Since the tab width may be something like 31,6 px per tab, we
456  * let the last tab have all the extra space (0,6 * children). */
457  if (i == (p->children - 1)) {
458  child->deco_rect.width = child->rect.width - child->deco_rect.x;
459  }
460 
461  if (p->children > 1 || (child->border_style != BS_PIXEL && child->border_style != BS_NONE)) {
462  child->rect.y += p->deco_height;
463  child->rect.height -= p->deco_height;
464  child->deco_rect.height = p->deco_height;
465  } else {
466  child->deco_rect.height = (child->border_style == BS_PIXEL ? 1 : 0);
467  }
468 }
469 
470 static void render_con_dockarea(Con *con, Con *child, render_params *p) {
471  assert(con->layout == L_DOCKAREA);
472 
473  child->rect.x = p->x;
474  child->rect.y = p->y;
475  child->rect.width = p->rect.width;
476  child->rect.height = child->geometry.height;
477 
478  child->deco_rect.x = 0;
479  child->deco_rect.y = 0;
480  child->deco_rect.width = 0;
481  child->deco_rect.height = 0;
482  p->y += child->rect.height;
483 }
484 
485 /*
486  * Decides whether the container should be inset.
487  */
488 bool should_inset_con(Con *con, int children) {
489  /* Don't inset floating containers and workspaces. */
490  if (con->type == CT_FLOATING_CON || con->type == CT_WORKSPACE)
491  return false;
492 
493  if (con_is_leaf(con))
494  return true;
495 
496  return (con->layout == L_STACKED || con->layout == L_TABBED) && children > 0;
497 }
498 
499 /*
500  * Returns whether the given container has an adjacent container in the
501  * specified direction. In other words, this returns true if and only if
502  * the container is not touching the edge of the screen in that direction.
503  */
504 bool has_adjacent_container(Con *con, direction_t direction) {
505  Con *workspace = con_get_workspace(con);
506  Con *fullscreen = con_get_fullscreen_con(workspace, CF_GLOBAL);
507  if (fullscreen == NULL)
508  fullscreen = con_get_fullscreen_con(workspace, CF_OUTPUT);
509 
510  /* If this container is fullscreen by itself, there's no adjacent container. */
511  if (con == fullscreen)
512  return false;
513 
514  Con *first = con;
515  Con *second = NULL;
516  bool found_neighbor = resize_find_tiling_participants(&first, &second, direction, false);
517  if (!found_neighbor)
518  return false;
519 
520  /* If we have an adjacent container and nothing is fullscreen, we consider it. */
521  if (fullscreen == NULL)
522  return true;
523 
524  /* For fullscreen containers, only consider the adjacent container if it is also fullscreen. */
525  return con_has_parent(con, fullscreen) && con_has_parent(second, fullscreen);
526 }
#define y(x,...)
Definition: commands.c:18
Con * con_get_fullscreen_covering_ws(Con *ws)
Returns the fullscreen node that covers the given workspace if it exists.
Definition: con.c:572
Con * con_get_workspace(Con *con)
Gets the workspace container this node is on.
Definition: con.c:476
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.
Definition: con.c:667
gaps_t calculate_effective_gaps(Con *con)
Calculates the effective gap sizes for a container.
Definition: con.c:2309
Con * con_get_fullscreen_con(Con *con, fullscreen_mode_t fullscreen_mode)
Returns the first fullscreen node below this node.
Definition: con.c:524
Con * con_descend_focused(Con *con)
Returns the focused con inside this client, descending the tree as far as possible.
Definition: con.c:1549
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...
Definition: con.c:1663
uint32_t con_rect_size_in_orientation(Con *con)
Returns given container's rect size depending on its orientation.
Definition: con.c:2513
bool con_is_internal(Con *con)
Returns true if the container is internal, such as __i3_scratch.
Definition: con.c:587
bool con_is_leaf(Con *con)
Returns true when this node is a leaf node (has no children)
Definition: con.c:360
int con_num_children(Con *con)
Returns the number of children of this container.
Definition: con.c:946
bool con_has_parent(Con *con, Con *parent)
Checks if the container has the given parent as an actual parent.
Definition: con.c:649
Config config
Definition: config.c:17
Con * output_get_content(Con *output)
Returns the output container below the given output container.
Definition: output.c:16
int render_deco_height(void)
Returns the height for the decorations.
Definition: render.c:29
bool has_adjacent_container(Con *con, direction_t direction)
Definition: render.c:504
static void render_con_stacked(Con *con, Con *child, render_params *p, int i)
Definition: render.c:424
void render_con(Con *con, bool already_inset)
"Renders" the given container (and its children), meaning that all rects are updated correctly.
Definition: render.c:44
static void render_output(Con *con)
Definition: render.c:301
static void render_root(Con *con, Con *fullscreen)
Definition: render.c:221
static void render_con_dockarea(Con *con, Con *child, render_params *p)
Definition: render.c:470
static int * precalculate_sizes(Con *con, render_params *p)
Definition: render.c:192
bool should_inset_con(Con *con, int children)
Definition: render.c:488
static void render_con_split(Con *con, Con *child, render_params *p, int i)
Definition: render.c:386
static void render_con_tabbed(Con *con, Con *child, render_params *p, int i)
Definition: render.c:443
bool resize_find_tiling_participants(Con **current, Con **other, direction_t direction, bool both_sides)
Definition: resize.c:70
struct Con * focused
Definition: tree.c:13
Rect rect_add(Rect a, Rect b)
Definition: util.c:39
Rect rect_sanitize_dimensions(Rect rect)
Definition: util.c:53
void x_raise_con(Con *con)
Raises the specified container in the internal stack of X windows.
Definition: x.c:1368
struct Rect Rect
Definition: data.h:41
@ L_STACKED
Definition: data.h:102
@ L_TABBED
Definition: data.h:103
@ L_DOCKAREA
Definition: data.h:104
@ L_OUTPUT
Definition: data.h:105
@ L_SPLITH
Definition: data.h:107
@ L_SPLITV
Definition: data.h:106
@ CF_OUTPUT
Definition: data.h:611
@ CF_GLOBAL
Definition: data.h:612
@ CF_NONE
Definition: data.h:610
@ BS_NONE
Definition: data.h:63
@ BS_PIXEL
Definition: data.h:64
@ BS_NORMAL
Definition: data.h:62
direction_t
Definition: data.h:53
@ D_RIGHT
Definition: data.h:54
@ D_LEFT
Definition: data.h:53
@ D_UP
Definition: data.h:55
@ D_DOWN
Definition: data.h:56
#define DLOG(fmt,...)
Definition: libi3.h:104
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)
Definition: queue.h:347
#define TAILQ_FIRST(head)
Definition: queue.h:336
#define TAILQ_FOREACH_REVERSE(var, head, headname, field)
Definition: queue.h:352
#define TAILQ_EMPTY(head)
Definition: queue.h:344
#define FREE(pointer)
Definition: util.h:47
i3Font font
Definition: configuration.h:93
enum Config::@8 popup_during_fullscreen
What should happen when a new popup is opened during fullscreen mode.
Definition: data.h:145
int inner
Definition: data.h:146
int left
Definition: data.h:150
int right
Definition: data.h:148
int top
Definition: data.h:147
int bottom
Definition: data.h:149
Stores a rectangle, for example the size of a window, the child window etc.
Definition: data.h:173
uint32_t height
Definition: data.h:177
uint32_t x
Definition: data.h:174
uint32_t y
Definition: data.h:175
uint32_t width
Definition: data.h:176
xcb_window_t id
Definition: data.h:413
xcb_window_t transient_for
Definition: data.h:418
A 'Con' represents everything from the X11 root window down to a single X11 window.
Definition: data.h:624
struct Rect deco_rect
Definition: data.h:669
int border_width
Definition: data.h:691
double percent
Definition: data.h:688
struct Rect rect
Definition: data.h:663
enum Con::@20 type
layout_t layout
Definition: data.h:731
bool mapped
Definition: data.h:625
struct Rect window_rect
Definition: data.h:666
struct Window * window
Definition: data.h:694
border_style_t border_style
Definition: data.h:732
char * name
Definition: data.h:673
struct Rect geometry
the geometry this window requested when getting mapped
Definition: data.h:671
fullscreen_mode_t fullscreen_mode
Definition: data.h:710
int height
The height of the font, built from font_ascent + font_descent.
Definition: libi3.h:67
This is used to keep a state to pass around when rendering a con in render_con().
Definition: render.h:19
Rect rect
Definition: render.h:28
int children
Definition: render.h:30
int * sizes
Definition: render.h:32
int deco_height
Definition: render.h:25