47 DLOG(
"Rendering %snode %p / %s / layout %d / children %d\n",
48 (render_fullscreen ?
"fullscreen " :
""), con, con->
name, con->
layout,
60 if (!render_fullscreen)
77 DLOG(
"aspect_ratio = %f, current width/height are %d/%d\n",
79 double new_height = inset->
height + 1;
80 int new_width = inset->
width;
82 while (new_height > inset->
height) {
85 if (new_height > inset->
height)
89 inset->
y += ceil(inset->
height / 2) - floor((new_height + .5) / 2);
90 inset->
x += ceil(inset->
width / 2) - floor(new_width / 2);
92 inset->
height = new_height + .5;
93 inset->
width = new_width;
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",
191 int i = 0, assigned = 0;
195 assigned += sizes[i++] = percentage * total;
197 assert(assigned == total ||
198 (assigned > total && assigned - total <= p->children * 2) ||
199 (assigned < total && total - assigned <= p->children * 2));
200 int signal = assigned < total ? 1 : -1;
201 while (assigned != total) {
202 for (i = 0; i < p->
children && assigned != total; ++i) {
224 DLOG(
"Rendering floating windows:\n");
231 DLOG(
"Skipping this output because it is currently being destroyed.\n");
245 if (fullscreen != NULL && fullscreen->
window == NULL)
247 if (fullscreen != NULL && fullscreen->
window != NULL) {
249 Con *transient_con = floating_child;
250 bool is_transient_for =
false;
254 while (transient_con != NULL &&
255 transient_con->
window != NULL &&
257 DLOG(
"transient_con = 0x%08x, transient_con->window->transient_for = 0x%08x, fullscreen_id = 0x%08x\n",
260 is_transient_for =
true;
264 if (next_transient == NULL)
269 if (transient_con == next_transient)
271 transient_con = next_transient;
274 if (!is_transient_for)
277 DLOG(
"Rendering floating child even though in fullscreen mode: " 278 "floating->transient_for (0x%08x) --> fullscreen->id (0x%08x)\n",
282 DLOG(
"floating child at (%d,%d) with %d x %d\n",
296 Con *child, *dockchild;
306 if (child->
type == CT_CON) {
307 if (content != NULL) {
308 DLOG(
"More than one CT_CON on output container\n");
312 }
else if (child->
type != CT_DOCKAREA) {
313 DLOG(
"Child %p of type %d is inside the OUTPUT con\n", child, child->
type);
318 if (content == NULL) {
319 DLOG(
"Skipping this output because it is currently being destroyed.\n");
328 DLOG(
"Skipping this output because it is currently being destroyed.\n");
342 if (child->
type != CT_DOCKAREA)
354 if (child->
type == CT_CON) {
372 DLOG(
"child at (%d, %d) with (%d x %d)\n",
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...
static void render_root(Con *con, Con *fullscreen)
#define TAILQ_EMPTY(head)
A 'Con' represents everything from the X11 root window down to a single X11 window.
static void render_con_dockarea(Con *con, Con *child, render_params *p)
xcb_window_t transient_for
bool con_is_leaf(Con *con)
Returns true when this node is a leaf node (has no children)
static void render_con_stacked(Con *con, Con *child, render_params *p, int i)
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...
int height
The height of the font, built from font_ascent + font_descent.
struct Rect geometry
the geometry this window requested when getting mapped
static void render_output(Con *con)
int con_num_children(Con *con)
Returns the number of children of this container.
#define TAILQ_FOREACH(var, head, field)
#define TAILQ_FIRST(head)
orientation_t con_orientation(Con *con)
Returns the orientation of the given container (for stacked containers, vertical orientation is used ...
void render_con(Con *con, bool render_fullscreen)
"Renders" the given container (and its children), meaning that all rects are updated correctly...
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...
Con * output_get_content(Con *output)
Returns the output container below the given output container.
Con * con_descend_focused(Con *con)
Returns the focused con inside this client, descending the tree as far as possible.
static void render_con_split(Con *con, Con *child, render_params *p, int i)
static int * precalculate_sizes(Con *con, render_params *p)
static void render_con_tabbed(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.
border_style_t border_style
void x_raise_con(Con *con)
Raises the specified container in the internal stack of X windows.
Rect rect_add(Rect a, Rect b)
int render_deco_height(void)
Stores a rectangle, for example the size of a window, the child window etc.
#define TAILQ_FOREACH_REVERSE(var, head, headname, field)