diff options
| author | Furkan Sahin <furkan-dev@proton.me> | 2018-11-02 01:34:33 -0700 |
|---|---|---|
| committer | Furkan Sahin <furkan-dev@proton.me> | 2018-11-02 01:34:33 -0700 |
| commit | a666edb0e66b9a4f9edc5d2671b88ed391f87f26 (patch) | |
| tree | 5dfe97b2acfe005b74fc23fa4db8ab04b91aa747 /swaymsg | |
| parent | bc5249acb725c2d7ef035d43e83cd01445410ff9 (diff) | |
swaymsg: get_outputs: use output->current_mode for current mode display
Diffstat (limited to 'swaymsg')
| -rw-r--r-- | swaymsg/main.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/swaymsg/main.c b/swaymsg/main.c index 3c984225..e13dd7ec 100644 --- a/swaymsg/main.c +++ b/swaymsg/main.c @@ -183,13 +183,15 @@ static void pretty_print_output(json_object *o) { json_object_object_get_ex(rect, "height", &height); json_object *modes; json_object_object_get_ex(o, "modes", &modes); + json_object *current_mode; + json_object_object_get_ex(o, "current_mode", ¤t_mode); if (json_object_get_boolean(active)) { printf( "Output %s '%s %s %s'%s\n" " Current mode: %dx%d @ %f Hz\n" " Position: %d,%d\n" - " Scale factor: %dx\n" + " Scale factor: %f\n" " Transform: %s\n" " Workspace: %s\n", json_object_get_string(name), @@ -197,10 +199,13 @@ static void pretty_print_output(json_object *o) { json_object_get_string(model), json_object_get_string(serial), json_object_get_boolean(focused) ? " (focused)" : "", - json_object_get_int(width), json_object_get_int(height), + json_object_get_int( + json_object_object_get(current_mode, "width")), + json_object_get_int( + json_object_object_get(current_mode, "height")), (float)json_object_get_int(refresh) / 1000, json_object_get_int(x), json_object_get_int(y), - json_object_get_int(scale), + json_object_get_double(scale), json_object_get_string(transform), json_object_get_string(ws) ); |
