summaryrefslogtreecommitdiffstats
path: root/swaybar
diff options
context:
space:
mode:
authorLibravatar Björn Esser <besser82@fedoraproject.org>2017-12-14 01:30:54 +0100
committerLibravatar Drew DeVault <sir@cmpwn.com>2017-12-17 15:53:22 -0500
commitc08c805ecd8f2000a35cdeae7b16244d0b3c0528 (patch)
tree8a1a12a32a1d2c40bc4fdb43aa7205362438f65b /swaybar
parentRevert "Merge remote-tracking branch 'besser82/bugfix/json-c' into 0.15" (diff)
downloadsway-c08c805ecd8f2000a35cdeae7b16244d0b3c0528.tar.gz
sway-c08c805ecd8f2000a35cdeae7b16244d0b3c0528.tar.zst
sway-c08c805ecd8f2000a35cdeae7b16244d0b3c0528.zip
Adaptions for API change in json-c v0.130.15.1
Lift restriction on json-c <= 0.12.1 ipc-server: Acquire ownership of referenced json_object properly When adding a referenced json_object with an unknown lifetime to another json_object, it must be done with a wrapped call to json_object_get() to acquire the ownership of that json_object.
Diffstat (limited to 'swaybar')
-rw-r--r--swaybar/status_line.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/swaybar/status_line.c b/swaybar/status_line.c
index 87e90caf..e3cc0bf4 100644
--- a/swaybar/status_line.c
+++ b/swaybar/status_line.c
@@ -2,8 +2,8 @@
2#include <stdlib.h> 2#include <stdlib.h>
3#include <string.h> 3#include <string.h>
4#include <unistd.h> 4#include <unistd.h>
5#include <json-c/json.h>
6 5
6#include "sway_json_helper.h"
7#include "swaybar/config.h" 7#include "swaybar/config.h"
8#include "swaybar/status_line.h" 8#include "swaybar/status_line.h"
9#include "log.h" 9#include "log.h"
@@ -70,8 +70,7 @@ static void parse_json(struct bar *bar, const char *text) {
70 70
71 bar->status->block_line = create_list(); 71 bar->status->block_line = create_list();
72 72
73 int i; 73 for (json_ar_len_t i = 0; i < json_object_array_length(results); ++i) {
74 for (i = 0; i < json_object_array_length(results); ++i) {
75 json_object *full_text, *short_text, *color, *min_width, *align, *urgent; 74 json_object *full_text, *short_text, *color, *min_width, *align, *urgent;
76 json_object *name, *instance, *separator, *separator_block_width; 75 json_object *name, *instance, *separator, *separator_block_width;
77 json_object *background, *border, *border_top, *border_bottom; 76 json_object *background, *border, *border_top, *border_bottom;