]> git.sur5r.net Git - i3/i3/commitdiff
Bugfix for previous commit: Don’t crash with dock windows
authorMichael Stapelberg <michael@stapelberg.de>
Mon, 6 Aug 2012 01:11:11 +0000 (03:11 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Mon, 6 Aug 2012 01:11:11 +0000 (03:11 +0200)
src/con.c
src/x.c

index 6f2a85b2d39be1f1bf918e2b7ccf127b9e7740b3..eb7333552fd63ae11a68580401365a69f4324296 100644 (file)
--- a/src/con.c
+++ b/src/con.c
@@ -936,8 +936,12 @@ Con *con_descend_direction(Con *con, direction_t direction) {
 Rect con_border_style_rect(Con *con) {
     adjacent_t borders_to_hide = ADJ_NONE;
     Rect result;
+    /* Shortcut to avoid calling con_adjacent_borders() on dock containers. */
+    int border_style = con_border_style(con);
+    if (border_style == BS_NONE)
+        return (Rect){ 0, 0, 0, 0 };
     borders_to_hide = con_adjacent_borders(con) & config.hide_edge_borders;
-    switch (con_border_style(con)) {
+    switch (border_style) {
     case BS_NORMAL:
         result = (Rect){2, 0, -(2 * 2), -2};
         if (borders_to_hide & ADJ_LEFT_SCREEN_EDGE) {
diff --git a/src/x.c b/src/x.c
index cd85bcc6be7546fbfbf0a270a42fd21c2d3c80ce..9aea9fb8bc93f696d64edf1242a9f6a2908bd113 100644 (file)
--- a/src/x.c
+++ b/src/x.c
@@ -305,13 +305,14 @@ void x_draw_decoration(Con *con) {
      *  • non-leaf containers which are in a stacked/tabbed container
      *
      * It does not need to run for:
-     *  • direct children of outputs
+     *  • direct children of outputs or dockareas
      *  • floating containers (they don’t have a decoration)
      */
     if ((!leaf &&
          parent->layout != L_STACKED &&
          parent->layout != L_TABBED) ||
         parent->type == CT_OUTPUT ||
+        parent->type == CT_DOCKAREA ||
         con->type == CT_FLOATING_CON)
         return;