2 #define I3__FILE__ "render.c"
25 Con *child, *dockchild;
35 if (child->
type == CT_CON) {
36 if (content != NULL) {
37 DLOG(
"More than one CT_CON on output container\n");
41 }
else if (child->
type != CT_DOCKAREA) {
42 DLOG(
"Child %p of type %d is inside the OUTPUT con\n", child, child->
type);
47 assert(content != NULL);
64 if (child->
type != CT_DOCKAREA)
76 if (child->
type == CT_CON) {
94 DLOG(
"child at (%d, %d) with (%d x %d)\n",
111 DLOG(
"Rendering %snode %p / %s / layout %d / children %d\n",
112 (render_fullscreen ?
"fullscreen " :
""), con, con->
name, con->
layout,
141 if (!render_fullscreen)
157 if (!render_fullscreen &&
160 double new_height = inset->
height + 1;
161 int new_width = inset->
width;
163 while (new_height > inset->
height) {
166 if (new_height > inset->
height)
170 inset->
y += ceil(inset->
height / 2) - floor(new_height / 2);
171 inset->
x += ceil(inset->
width / 2) - floor(new_width / 2);
173 inset->
height = new_height;
174 inset->
width = new_width;
183 DLOG(
"child will be at %dx%d with size %dx%d\n", inset->
x, inset->
y, inset->
width, inset->
height);
187 Con *fullscreen = NULL;
188 if (con->
type != CT_OUTPUT) {
192 fullscreen->
rect = rect;
205 if ((con->
layout == L_SPLITH || con->
layout == L_SPLITV) && children > 0) {
208 int i = 0, assigned = 0;
211 double percentage = child->
percent > 0.0 ? child->
percent : 1.0 / children;
212 assigned += sizes[i++] = percentage * total;
214 assert(assigned == total ||
215 (assigned > total && assigned - total <= children * 2) ||
216 (assigned < total && total - assigned <= children * 2));
217 int signal = assigned < total ? 1 : -1;
218 while (assigned != total) {
219 for (i = 0; i < children && assigned != total; ++i) {
226 if (con->
layout == L_OUTPUT) {
231 }
else if (con->
type == CT_ROOT) {
241 DLOG(
"Rendering floating windows:\n");
250 TAILQ_FOREACH(child, &(workspace->floating_head), floating_windows) {
254 if (fullscreen != NULL) {
259 if (floating_child->
window == NULL ||
260 fullscreen->
window == NULL ||
264 DLOG(
"Rendering floating child even though in fullscreen mode: "
265 "floating->transient_for (0x%08x) == fullscreen->id (0x%08x)\n",
269 DLOG(
"floating child at (%d,%d) with %d x %d\n",
281 assert(children > 0);
284 if (con->
layout == L_SPLITH || con->
layout == L_SPLITV) {
285 if (con->
layout == L_SPLITH) {
305 child->
rect.
y += deco_height;
314 else if (con->
layout == L_STACKED) {
326 child->
rect.
y += (deco_height * children);
327 child->
rect.
height -= (deco_height * children);
332 else if (con->
layout == L_TABBED) {
343 child->
rect.
y += deco_height;
352 else if (con->
layout == L_DOCKAREA) {
365 DLOG(
"child at (%d, %d) with (%d x %d)\n",
373 if (con->
layout == L_STACKED || con->
layout == L_TABBED) {