Do not create container pixmap when not needed
Patch status: superseded
Patch by Tony Crisci
Long description:
A pixmap for a floating container without a border is not necessary because nothing meaningful will be drawn to it. It could possibly obscure areas meant to be transparent by the client. fixes #1013
To apply this patch, use:
curl http://cr.i3wm.org/patch/380/raw.patch | git am
b/src/x.c
18 |
@@ -667,9 +667,11 @@ void x_push_node(Con *con) { |
19 |
/* As the pixmap only depends on the size and not on the position, it |
20 |
* is enough to check if width/height have changed. Also, we don’t |
21 |
* create a pixmap at all when the window is actually not visible |
22 |
- * (height == 0). */ |
23 |
- if ((state->rect.width != rect.width || |
24 |
- state->rect.height != rect.height)) { |
25 |
+ * (height == 0) or when it is not needed (floating and border_style == |
26 |
+ * BS_NONE). */ |
27 |
+ bool has_rect_changed = !(state->rect.width == rect.width && state->rect.height == rect.height); |
28 |
+ bool is_pixmap_needed = !(con->border_style == BS_NONE && con_is_floating(con)); |
29 |
+ if (has_rect_changed && is_pixmap_needed) { |
30 |
if (con->pixmap == 0) { |
31 |
con->pixmap = xcb_generate_id(conn); |
32 |
con->pm_gc = xcb_generate_id(conn); |