diff options
Diffstat (limited to 'swaymsg/main.c')
-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) { | |||
183 | json_object_object_get_ex(rect, "height", &height); | 183 | json_object_object_get_ex(rect, "height", &height); |
184 | json_object *modes; | 184 | json_object *modes; |
185 | json_object_object_get_ex(o, "modes", &modes); | 185 | json_object_object_get_ex(o, "modes", &modes); |
186 | json_object *current_mode; | ||
187 | json_object_object_get_ex(o, "current_mode", ¤t_mode); | ||
186 | 188 | ||
187 | if (json_object_get_boolean(active)) { | 189 | if (json_object_get_boolean(active)) { |
188 | printf( | 190 | printf( |
189 | "Output %s '%s %s %s'%s\n" | 191 | "Output %s '%s %s %s'%s\n" |
190 | " Current mode: %dx%d @ %f Hz\n" | 192 | " Current mode: %dx%d @ %f Hz\n" |
191 | " Position: %d,%d\n" | 193 | " Position: %d,%d\n" |
192 | " Scale factor: %dx\n" | 194 | " Scale factor: %f\n" |
193 | " Transform: %s\n" | 195 | " Transform: %s\n" |
194 | " Workspace: %s\n", | 196 | " Workspace: %s\n", |
195 | json_object_get_string(name), | 197 | json_object_get_string(name), |
@@ -197,10 +199,13 @@ static void pretty_print_output(json_object *o) { | |||
197 | json_object_get_string(model), | 199 | json_object_get_string(model), |
198 | json_object_get_string(serial), | 200 | json_object_get_string(serial), |
199 | json_object_get_boolean(focused) ? " (focused)" : "", | 201 | json_object_get_boolean(focused) ? " (focused)" : "", |
200 | json_object_get_int(width), json_object_get_int(height), | 202 | json_object_get_int( |
203 | json_object_object_get(current_mode, "width")), | ||
204 | json_object_get_int( | ||
205 | json_object_object_get(current_mode, "height")), | ||
201 | (float)json_object_get_int(refresh) / 1000, | 206 | (float)json_object_get_int(refresh) / 1000, |
202 | json_object_get_int(x), json_object_get_int(y), | 207 | json_object_get_int(x), json_object_get_int(y), |
203 | json_object_get_int(scale), | 208 | json_object_get_double(scale), |
204 | json_object_get_string(transform), | 209 | json_object_get_string(transform), |
205 | json_object_get_string(ws) | 210 | json_object_get_string(ws) |
206 | ); | 211 | ); |