aboutsummaryrefslogtreecommitdiff
path: root/swaymsg/main.c
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2025-07-05 13:25:51 +0200
committerKenny Levinsen <kl@kl.wtf>2025-07-08 15:58:53 +0200
commitc7d7d56f61f820989aa4ca6ee6267fe0bd31f5f6 (patch)
treedea0dd9202de9d68c701ea5d32be442e2dfbd987 /swaymsg/main.c
parenta1ac2a2e93ffb3341253af30603cf16483d766bb (diff)
ipc-json, swaymsg: indicate when adaptive sync is unsupported
Diffstat (limited to 'swaymsg/main.c')
-rw-r--r--swaymsg/main.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/swaymsg/main.c b/swaymsg/main.c
index 6a9eb198..9152b794 100644
--- a/swaymsg/main.c
+++ b/swaymsg/main.c
@@ -210,6 +210,9 @@ static void pretty_print_output(json_object *o) {
json_object_object_get_ex(current_mode, "width", &width);
json_object_object_get_ex(current_mode, "height", &height);
json_object_object_get_ex(current_mode, "refresh", &refresh);
+ json_object *features, *features_adaptive_sync;
+ json_object_object_get_ex(o, "features", &features);
+ json_object_object_get_ex(features, "adaptive_sync", &features_adaptive_sync);
if (json_object_get_boolean(non_desktop)) {
printf(
@@ -252,7 +255,9 @@ static void pretty_print_output(json_object *o) {
printf(max_render_time_int == 0 ? "off\n" : "%d ms\n", max_render_time_int);
printf(" Adaptive sync: %s\n",
- json_object_get_string(adaptive_sync_status));
+ json_object_get_boolean(features_adaptive_sync) ?
+ json_object_get_string(adaptive_sync_status) :
+ "unsupported");
printf(" Allow tearing: %s\n",
json_object_get_boolean(allow_tearing) ? "yes" : "no");