summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2018-01-13 09:17:54 -0500
committerLibravatar GitHub <noreply@github.com>2018-01-13 09:17:54 -0500
commit0ff89cf0d12e3969af9e5463db41316c61bdf029 (patch)
tree5c98beffeb67ac5f30aabe3aa9b5be175accefac
parentMerge pull request #1561 from pvsr/0.15 (diff)
parentCalculate positions of empty blocks in swaybar (diff)
downloadsway-0ff89cf0d12e3969af9e5463db41316c61bdf029.tar.gz
sway-0ff89cf0d12e3969af9e5463db41316c61bdf029.tar.zst
sway-0ff89cf0d12e3969af9e5463db41316c61bdf029.zip
Merge pull request #1564 from pvsr/0.15
Calculate positions of empty blocks in swaybar
-rw-r--r--swaybar/render.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/swaybar/render.c b/swaybar/render.c
index 6fc09078..e874fc86 100644
--- a/swaybar/render.c
+++ b/swaybar/render.c
@@ -97,6 +97,10 @@ static void render_block(struct window *window, struct config *config, struct st
97 block->x = (int)pos; 97 block->x = (int)pos;
98 block->width = (int)block_width; 98 block->width = (int)block_width;
99 99
100 if (!block->full_text || !block->full_text[0]) {
101 return;
102 }
103
100 // render background 104 // render background
101 if (block->background != 0x0) { 105 if (block->background != 0x0) {
102 cairo_set_source_u32(window->cairo, block->background); 106 cairo_set_source_u32(window->cairo, block->background);
@@ -330,10 +334,8 @@ void render(struct output *output, struct config *config, struct status_line *li
330 bool edge = true; 334 bool edge = true;
331 for (i = line->block_line->length - 1; i >= 0; --i) { 335 for (i = line->block_line->length - 1; i >= 0; --i) {
332 struct status_block *block = line->block_line->items[i]; 336 struct status_block *block = line->block_line->items[i];
333 if (block->full_text && block->full_text[0]) { 337 render_block(window, config, block, &pos, edge, is_focused);
334 render_block(window, config, block, &pos, edge, is_focused); 338 edge = false;
335 edge = false;
336 }
337 } 339 }
338 } 340 }
339 341