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",
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",
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)
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_EMPTY(head)
static void render_con_dockarea(Con *con, Con *child, render_params *p)
void x_raise_con(Con *con)
Raises the specified container in the internal stack of X windows.
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)
#define TAILQ_FOREACH_REVERSE(var, head, headname, field)
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...
This is used to keep a state to pass around when rendering a con in render_con(). ...
static void render_output(Con *con)
#define TAILQ_FIRST(head)
int con_num_children(Con *con)
Returns the number of children of this container.
Stores a rectangle, for example the size of a window, the child window etc.
orientation_t con_orientation(Con *con)
Returns the orientation of the given container (for stacked containers, vertical orientation is used ...
struct Rect geometry
the geometry this window requested when getting mapped
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.
Con * output_get_content(Con *output)
Returns the output container below the given output container.
Rect rect_add(Rect a, Rect b)
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)
xcb_window_t transient_for
static int * precalculate_sizes(Con *con, render_params *p)
int height
The height of the font, built from font_ascent + font_descent.
A 'Con' represents everything from the X11 root window down to a single X11 window.
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.
enum Config::@8 popup_during_fullscreen
What should happen when a new popup is opened during fullscreen mode.
int render_deco_height(void)
Returns the height for the decorations.
Con * con_get_fullscreen_covering_ws(Con *ws)
Returns the fullscreen node that covers the given workspace if it exists.
#define TAILQ_FOREACH(var, head, field)
border_style_t border_style