aboutsummaryrefslogtreecommitdiffstats
path: root/swaymsg
diff options
context:
space:
mode:
authorLibravatar Ivan Molodetskikh <yalterz@gmail.com>2019-09-25 17:55:30 +0300
committerLibravatar Simon Ser <contact@emersion.fr>2019-11-17 20:18:42 +0100
commitfe84ec2f24db6d0677d6350719fcd500fcb9b572 (patch)
tree8ef8b53aa3b6b47d64079aef5a010ad34a78ab6d /swaymsg
parentview: add max_render_time (diff)
downloadsway-fe84ec2f24db6d0677d6350719fcd500fcb9b572.tar.gz
sway-fe84ec2f24db6d0677d6350719fcd500fcb9b572.tar.zst
sway-fe84ec2f24db6d0677d6350719fcd500fcb9b572.zip
Add max_render_time to output JSON
Diffstat (limited to 'swaymsg')
-rw-r--r--swaymsg/main.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/swaymsg/main.c b/swaymsg/main.c
index a018a68e..596cf4ef 100644
--- a/swaymsg/main.c
+++ b/swaymsg/main.c
@@ -189,13 +189,14 @@ static void pretty_print_output(json_object *o) {
189 json_object_object_get_ex(o, "focused", &focused); 189 json_object_object_get_ex(o, "focused", &focused);
190 json_object_object_get_ex(o, "active", &active); 190 json_object_object_get_ex(o, "active", &active);
191 json_object_object_get_ex(o, "current_workspace", &ws); 191 json_object_object_get_ex(o, "current_workspace", &ws);
192 json_object *make, *model, *serial, *scale, *subpixel, *transform; 192 json_object *make, *model, *serial, *scale, *subpixel, *transform, *max_render_time;
193 json_object_object_get_ex(o, "make", &make); 193 json_object_object_get_ex(o, "make", &make);
194 json_object_object_get_ex(o, "model", &model); 194 json_object_object_get_ex(o, "model", &model);
195 json_object_object_get_ex(o, "serial", &serial); 195 json_object_object_get_ex(o, "serial", &serial);
196 json_object_object_get_ex(o, "scale", &scale); 196 json_object_object_get_ex(o, "scale", &scale);
197 json_object_object_get_ex(o, "subpixel_hinting", &subpixel); 197 json_object_object_get_ex(o, "subpixel_hinting", &subpixel);
198 json_object_object_get_ex(o, "transform", &transform); 198 json_object_object_get_ex(o, "transform", &transform);
199 json_object_object_get_ex(o, "max_render_time", &max_render_time);
199 json_object *x, *y; 200 json_object *x, *y;
200 json_object_object_get_ex(rect, "x", &x); 201 json_object_object_get_ex(rect, "x", &x);
201 json_object_object_get_ex(rect, "y", &y); 202 json_object_object_get_ex(rect, "y", &y);
@@ -215,7 +216,8 @@ static void pretty_print_output(json_object *o) {
215 " Scale factor: %f\n" 216 " Scale factor: %f\n"
216 " Subpixel hinting: %s\n" 217 " Subpixel hinting: %s\n"
217 " Transform: %s\n" 218 " Transform: %s\n"
218 " Workspace: %s\n", 219 " Workspace: %s\n"
220 " Max render time: ",
219 json_object_get_string(name), 221 json_object_get_string(name),
220 json_object_get_string(make), 222 json_object_get_string(make),
221 json_object_get_string(model), 223 json_object_get_string(model),
@@ -230,6 +232,8 @@ static void pretty_print_output(json_object *o) {
230 json_object_get_string(transform), 232 json_object_get_string(transform),
231 json_object_get_string(ws) 233 json_object_get_string(ws)
232 ); 234 );
235 int max_render_time_int = json_object_get_int(max_render_time);
236 printf(max_render_time_int == 0 ? "off\n" : "%d ms\n", max_render_time_int);
233 } else { 237 } else {
234 printf( 238 printf(
235 "Output %s '%s %s %s' (inactive)\n", 239 "Output %s '%s %s %s' (inactive)\n",