diff options
| author | Furkan Sahin <furkan-dev@proton.me> | 2025-07-08 18:52:29 +0200 |
|---|---|---|
| committer | Furkan Sahin <furkan-dev@proton.me> | 2025-07-08 18:52:29 +0200 |
| commit | 2200a27d8a3083c5a32486c8317fad099732d8de (patch) | |
| tree | e585f1360c33af8a09a04b3a9d7a98e71532c455 /swaymsg/main.c | |
| parent | e391b1780d792701a699d9cd170b0df3ff855a64 (diff) | |
Add features.hdr to output IPC response
Diffstat (limited to 'swaymsg/main.c')
| -rw-r--r-- | swaymsg/main.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/swaymsg/main.c b/swaymsg/main.c index 1c6e807c..d58f29e2 100644 --- a/swaymsg/main.c +++ b/swaymsg/main.c @@ -212,9 +212,10 @@ 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 *features, *features_adaptive_sync, *features_hdr; json_object_object_get_ex(o, "features", &features); json_object_object_get_ex(features, "adaptive_sync", &features_adaptive_sync); + json_object_object_get_ex(features, "hdr", &features_hdr); if (json_object_get_boolean(non_desktop)) { printf( @@ -263,7 +264,12 @@ static void pretty_print_output(json_object *o) { printf(" Allow tearing: %s\n", json_object_get_boolean(allow_tearing) ? "yes" : "no"); - printf(" HDR: %s\n", json_object_get_boolean(hdr) ? "on" : "off"); + + const char *hdr_str = "unsupported"; + if (json_object_get_boolean(features_hdr)) { + hdr_str = json_object_get_boolean(hdr) ? "on" : "off"; + } + printf(" HDR: %s\n", hdr_str); } else { printf( "Output %s '%s %s %s' (disabled)\n", |
