Fix decoration rect size for windows without border
Patch status: merged
Patch by Marius Muja
To apply this patch, use:
curl http://cr.i3wm.org/patch/20/raw.patch | git am
b/src/render.c
| 13 |
@@ -298,16 +298,24 @@ void render_con(Con *con, bool render_fullscreen) {
|
| 14 |
} |
| 15 |
|
| 16 |
/* first we have the decoration, if this is a leaf node */ |
| 17 |
- if (con_is_leaf(child) && child->border_style == BS_NORMAL) {
|
| 18 |
- /* TODO: make a function for relative coords? */ |
| 19 |
- child->deco_rect.x = child->rect.x - con->rect.x; |
| 20 |
- child->deco_rect.y = child->rect.y - con->rect.y; |
| 21 |
+ if (con_is_leaf(child)) {
|
| 22 |
+ if (child->border_style == BS_NORMAL) {
|
| 23 |
+ /* TODO: make a function for relative coords? */ |
| 24 |
+ child->deco_rect.x = child->rect.x - con->rect.x; |
| 25 |
+ child->deco_rect.y = child->rect.y - con->rect.y; |
| 26 |
|
| 27 |
- child->rect.y += deco_height; |
| 28 |
- child->rect.height -= deco_height; |
| 29 |
+ child->rect.y += deco_height; |
| 30 |
+ child->rect.height -= deco_height; |
| 31 |
|
| 32 |
- child->deco_rect.width = child->rect.width; |
| 33 |
- child->deco_rect.height = deco_height; |
| 34 |
+ child->deco_rect.width = child->rect.width; |
| 35 |
+ child->deco_rect.height = deco_height; |
| 36 |
+ } |
| 37 |
+ else {
|
| 38 |
+ child->deco_rect.x = 0; |
| 39 |
+ child->deco_rect.y = 0; |
| 40 |
+ child->deco_rect.width = 0; |
| 41 |
+ child->deco_rect.height = 0; |
| 42 |
+ } |
| 43 |
} |
| 44 |
} |
| 45 |
|