i3 - improved tiling WM


Bugfix: missed case for decoration rerender

Patch status: merged

Patch by Tony Crisci

Long description:

Rerender the decoration when the container requires a pixmap and does
not have one.

fixes #1292

To apply this patch, use:
curl http://cr.i3wm.org/patch/608/raw.patch | git am

b/src/x.c

17
@@ -659,10 +659,18 @@ void x_push_node(Con *con) {
18
              con, con->window->id, con->ignore_unmap);
19
     }
20
 
21
+    /* The pixmap of a borderless leaf container will not be used except
22
+     * for the titlebar in a stack or tabs (issue #1013). */
23
+    bool is_pixmap_needed = (con->border_style != BS_NONE ||
24
+            !con_is_leaf(con) ||
25
+            con->parent->layout == L_STACKED ||
26
+            con->parent->layout == L_TABBED);
27
+
28
     bool fake_notify = false;
29
-    /* Set new position if rect changed (and if height > 0) */
30
-    if (memcmp(&(state->rect), &rect, sizeof(Rect)) != 0 &&
31
-        rect.height > 0) {
32
+    /* Set new position if rect changed (and if height > 0) or if the pixmap
33
+     * needs to be recreated */
34
+    if ((is_pixmap_needed && con->pixmap == XCB_NONE) || (memcmp(&(state->rect), &rect, sizeof(Rect)) != 0 &&
35
+        rect.height > 0)) {
36
         /* We first create the new pixmap, then render to it, set it as the
37
          * background and only afterwards change the window size. This reduces
38
          * flickering. */
39
@@ -673,13 +681,6 @@ void x_push_node(Con *con) {
40
          * (height == 0) or when it is not needed. */
41
         bool has_rect_changed = (state->rect.width != rect.width || state->rect.height != rect.height);
42
 
43
-        /* The pixmap of a borderless leaf container will not be used except
44
-         * for the titlebar in a stack or tabs (issue #1013). */
45
-        bool is_pixmap_needed = (con->border_style != BS_NONE ||
46
-                                 !con_is_leaf(con) ||
47
-                                 con->parent->layout == L_STACKED ||
48
-                                 con->parent->layout == L_TABBED);
49
-
50
         /* Check if the container has an unneeded pixmap left over from
51
          * previously having a border or titlebar. */
52
         if (!is_pixmap_needed && con->pixmap != XCB_NONE) {
53
@@ -687,7 +688,7 @@ void x_push_node(Con *con) {
54
             con->pixmap = XCB_NONE;
55
         }
56
 
57
-        if (has_rect_changed && is_pixmap_needed) {
58
+        if (is_pixmap_needed && (has_rect_changed || con->pixmap == XCB_NONE)) {
59
             if (con->pixmap == 0) {
60
                 con->pixmap = xcb_generate_id(conn);
61
                 con->pm_gc = xcb_generate_id(conn);