mirror of
https://github.com/swaywm/sway.git
synced 2025-10-31 22:25:26 -04:00
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.
This commit is contained in:
parent
babd9618b9
commit
70245c2cd5
2 changed files with 26 additions and 22 deletions
|
|
@ -12,11 +12,6 @@ enum status_protocol {
|
|||
PROTOCOL_I3BAR,
|
||||
};
|
||||
|
||||
struct text_protocol_state {
|
||||
char *buffer;
|
||||
size_t buffer_size;
|
||||
};
|
||||
|
||||
enum json_node_type {
|
||||
JSON_NODE_UNKNOWN,
|
||||
JSON_NODE_ARRAY,
|
||||
|
|
@ -63,7 +58,8 @@ struct status_line {
|
|||
const char *text;
|
||||
struct wl_list blocks; // i3bar_block::link
|
||||
|
||||
struct text_protocol_state text_state;
|
||||
char *buffer;
|
||||
size_t buffer_size;
|
||||
struct i3bar_protocol_state i3bar_state;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue