]> git.sur5r.net Git - i3/i3/blobdiff - src/render.c
Remove old code from randr.c and workspace.c
[i3/i3] / src / render.c
index 9e2fd3db233e57aa74c2200c8c3532e1332e16ae..a59d418b402b8f35e5afee1bc167c35b7c5023e9 100644 (file)
@@ -139,7 +139,9 @@ void render_con(Con *con, bool render_fullscreen) {
         if (!render_fullscreen)
             *inset = rect_add(*inset, con_border_style_rect(con));
 
+        DLOG("Starting with inset = (%d, %d) %d x %d\n", inset->x, inset->y, inset->width, inset->height);
         /* Obey x11 border */
+        DLOG("X11 border: %d\n", con->border_width);
         inset->width -= (2 * con->border_width);
         inset->height -= (2 * con->border_width);
 
@@ -193,12 +195,12 @@ void render_con(Con *con, bool render_fullscreen) {
     }
 
     /* find the height for the decorations */
-    i3Font *font = load_font(conn, config.font);
-    int deco_height = font->height + 5;
+    int deco_height = config.font.height + 5;
 
     /* precalculate the sizes to be able to correct rounding errors */
     int sizes[children];
     if (con->layout == L_DEFAULT && children > 0) {
+        assert(!TAILQ_EMPTY(&con->nodes_head));
         Con *child;
         int i = 0, assigned = 0;
         int total = con->orientation == HORIZ ? rect.width : rect.height;
@@ -225,6 +227,7 @@ void render_con(Con *con, bool render_fullscreen) {
         /* FIXME: refactor this into separate functions: */
     Con *child;
     TAILQ_FOREACH(child, &(con->nodes_head), nodes) {
+        assert(children > 0);
 
         /* default layout */
         if (con->layout == L_DEFAULT) {
@@ -320,13 +323,17 @@ void render_con(Con *con, bool render_fullscreen) {
 
     /* in a stacking or tabbed container, we ensure the focused client is raised */
     if (con->layout == L_STACKED || con->layout == L_TABBED) {
-        Con *foc = TAILQ_FIRST(&(con->focus_head));
-        if (foc != TAILQ_END(&(con->focus_head))) {
-            DLOG("con %p is stacking, raising %p\n", con, foc);
-            x_raise_con(foc);
-            /* by rendering the stacked container again, we handle the case
-             * that we have a non-leaf-container inside the stack. */
-            render_con(foc, false);
+        DLOG("stacked/tabbed, raising focused reverse\n");
+        TAILQ_FOREACH_REVERSE(child, &(con->focus_head), focus_head, focused)
+            x_raise_con(child);
+        DLOG("done\n");
+        if ((child = TAILQ_FIRST(&(con->focus_head)))) {
+            DLOG("con %p is stacking, raising %p\n", con, child);
+            /* By rendering the stacked container again, we handle the case
+             * that we have a non-leaf-container inside the stack. In that
+             * case, the children of the non-leaf-container need to be raised
+             * aswell. */
+            render_con(child, false);
         }
     }
     }