aboutsummaryrefslogtreecommitdiffstats
path: root/swaybar/status_line.c
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2018-03-31 14:39:18 -0400
committerLibravatar Drew DeVault <sir@cmpwn.com>2018-04-02 11:09:23 -0400
commit333dbcbe72b6af95573e374b66ad6ab63f274299 (patch)
treeb73facc5f8399ca6328898749941d5ae195dec8d /swaybar/status_line.c
parentDemarcate i3bar JSON into individual updates (diff)
downloadsway-333dbcbe72b6af95573e374b66ad6ab63f274299.tar.gz
sway-333dbcbe72b6af95573e374b66ad6ab63f274299.tar.zst
sway-333dbcbe72b6af95573e374b66ad6ab63f274299.zip
Render i3bar blocks
Diffstat (limited to 'swaybar/status_line.c')
-rw-r--r--swaybar/status_line.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/swaybar/status_line.c b/swaybar/status_line.c
index c94ac6d4..cc7e217f 100644
--- a/swaybar/status_line.c
+++ b/swaybar/status_line.c
@@ -17,13 +17,13 @@ void status_error(struct status_line *status, const char *text) {
17 status->text = text; 17 status->text = text;
18} 18}
19 19
20bool handle_status_readable(struct status_line *status) { 20bool status_handle_readable(struct status_line *status) {
21 char *line; 21 char *line;
22 switch (status->protocol) { 22 switch (status->protocol) {
23 case PROTOCOL_ERROR: 23 case PROTOCOL_ERROR:
24 return false; 24 return false;
25 case PROTOCOL_I3BAR: 25 case PROTOCOL_I3BAR:
26 if (i3bar_readable(status) > 0) { 26 if (i3bar_handle_readable(status) > 0) {
27 return true; 27 return true;
28 } 28 }
29 break; 29 break;
@@ -66,6 +66,7 @@ bool handle_status_readable(struct status_line *status) {
66 66
67 status->protocol = PROTOCOL_I3BAR; 67 status->protocol = PROTOCOL_I3BAR;
68 free(status->text_state.buffer); 68 free(status->text_state.buffer);
69 wl_list_init(&status->blocks);
69 status->i3bar_state.buffer_size = 4096; 70 status->i3bar_state.buffer_size = 4096;
70 status->i3bar_state.buffer = 71 status->i3bar_state.buffer =
71 malloc(status->i3bar_state.buffer_size); 72 malloc(status->i3bar_state.buffer_size);