From ccf1cc7c2daf345ee5b6777b5e9196f48bb1027c Mon Sep 17 00:00:00 2001 From: Andri Yngvason Date: Sat, 24 Sep 2022 15:20:56 +0000 Subject: [PATCH] sway/ipc-json: Handle automatic max_render_time --- sway/ipc-json.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sway/ipc-json.c b/sway/ipc-json.c index 763fb3fef..969ce9b25 100644 --- a/sway/ipc-json.c +++ b/sway/ipc-json.c @@ -342,7 +342,14 @@ static void ipc_json_describe_enabled_output(struct sway_output *output, json_object_object_add(object, "percent", json_object_new_double(percent)); } - json_object_object_add(object, "max_render_time", json_object_new_int(output->max_render_time)); + int max_render_time; + if (output->max_render_time == -1) { + max_render_time = -output->auto_max_render_time; + } else { + max_render_time = output->max_render_time; + } + json_object_object_add(object, "max_render_time", + json_object_new_int(max_render_time)); } json_object *ipc_json_describe_disabled_output(struct sway_output *output) {