aboutsummaryrefslogtreecommitdiffstats
path: root/include/swaybar
diff options
context:
space:
mode:
authorLibravatar Ian Fan <ianfan0@gmail.com>2018-09-17 13:43:27 +0100
committerLibravatar Ian Fan <ianfan0@gmail.com>2018-09-18 11:36:33 +0100
commit70245c2cd5c34586fa91eb784e58471869ba66bd (patch)
treec1a0f34b5b8815ab0fee61c37aff707e756f60b3 /include/swaybar
parentswaybar: only create i3bar block hotspot if click events are enabled (diff)
downloadsway-70245c2cd5c34586fa91eb784e58471869ba66bd.tar.gz
sway-70245c2cd5c34586fa91eb784e58471869ba66bd.tar.zst
sway-70245c2cd5c34586fa91eb784e58471869ba66bd.zip
swaybar: rewrite text protocol handling
This now uses getline to correctly handle multiple or long statuses. It also removes the struct text_protocol_state and moves its members into the status_line struct.
Diffstat (limited to 'include/swaybar')
-rw-r--r--include/swaybar/status_line.h8
1 files changed, 2 insertions, 6 deletions
diff --git a/include/swaybar/status_line.h b/include/swaybar/status_line.h
index 150267cd..857948a5 100644
--- a/include/swaybar/status_line.h
+++ b/include/swaybar/status_line.h
@@ -12,11 +12,6 @@ enum status_protocol {
12 PROTOCOL_I3BAR, 12 PROTOCOL_I3BAR,
13}; 13};
14 14
15struct text_protocol_state {
16 char *buffer;
17 size_t buffer_size;
18};
19
20enum json_node_type { 15enum json_node_type {
21 JSON_NODE_UNKNOWN, 16 JSON_NODE_UNKNOWN,
22 JSON_NODE_ARRAY, 17 JSON_NODE_ARRAY,
@@ -63,7 +58,8 @@ struct status_line {
63 const char *text; 58 const char *text;
64 struct wl_list blocks; // i3bar_block::link 59 struct wl_list blocks; // i3bar_block::link
65 60
66 struct text_protocol_state text_state; 61 char *buffer;
62 size_t buffer_size;
67 struct i3bar_protocol_state i3bar_state; 63 struct i3bar_protocol_state i3bar_state;
68}; 64};
69 65