diff options
| author | Furkan Sahin <furkan-dev@proton.me> | 2020-09-20 17:26:18 +0200 |
|---|---|---|
| committer | Furkan Sahin <furkan-dev@proton.me> | 2020-09-20 17:26:18 +0200 |
| commit | 1e475f4dcd78553a915f286679a9881a03878883 (patch) | |
| tree | 50475c92ec38ca6cf04495ba1f6b2d63c11c3dc7 /swaybar/render.c | |
| parent | 5fe0d6a8a06bbdbdc358e030be3d58e5ca0965e1 (diff) | |
swaybar: don't expand separator_block_width if separator is false
When swaybar receives the following JSON body
[
{
"full_text": "foo",
"separator": false,
"separator_block_width": 0
},
{
"full_text": "bar"
}
]
it should not draw any separator or any space between the two blocks.
However, since swaybar calculates that separator_block_width
0 is too small to fit any configured separator, it will override the
separator_block_width with some non-zero value. This patch changes
that such that the necessary separator_block_width is only expanded if
the block has 'separator: true'.
This should be in line to what i3 does, as its documentation of the
i3bar protocol for separator states that "[...] if you disable the
separator line, there will still be a gap after the block, unless you
also use separator_block_width".
Diffstat (limited to 'swaybar/render.c')
| -rw-r--r-- | swaybar/render.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/swaybar/render.c b/swaybar/render.c index 8f38174f..8816abef 100644 --- a/swaybar/render.c +++ b/swaybar/render.c @@ -208,7 +208,7 @@ static uint32_t render_status_block(cairo_t *cairo, output->height < _ideal_surface_height) { return _ideal_surface_height; } - if (sep_width > sep_block_width) { + if (block->separator && sep_width > sep_block_width) { sep_block_width = sep_width + margin * 2; } } |
