aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Cole Mickens <cole.mickens@gmail.com>2018-11-03 15:07:51 -0700
committerLibravatar Cole Mickens <cole.mickens@gmail.com>2018-11-03 15:09:34 -0700
commitef888321bacd22d061670d7172b21a79362d7d09 (patch)
tree0396af53f1684e36469ea8a651281d3c1228f391
parentfix: restore refresh to the modes_array (diff)
downloadsway-ef888321bacd22d061670d7172b21a79362d7d09.tar.gz
sway-ef888321bacd22d061670d7172b21a79362d7d09.tar.zst
sway-ef888321bacd22d061670d7172b21a79362d7d09.zip
ipc: move refresh from output to output->current_mode
-rw-r--r--sway/ipc-json.c4
-rw-r--r--swaymsg/main.c20
2 files changed, 11 insertions, 13 deletions
diff --git a/sway/ipc-json.c b/sway/ipc-json.c
index 7d4f75ed..4583558c 100644
--- a/sway/ipc-json.c
+++ b/sway/ipc-json.c
@@ -118,8 +118,6 @@ static void ipc_json_describe_output(struct sway_output *output,
118 json_object_new_string(wlr_output->serial)); 118 json_object_new_string(wlr_output->serial));
119 json_object_object_add(object, "scale", 119 json_object_object_add(object, "scale",
120 json_object_new_double(wlr_output->scale)); 120 json_object_new_double(wlr_output->scale));
121 json_object_object_add(object, "refresh",
122 json_object_new_int(wlr_output->refresh));
123 json_object_object_add(object, "transform", 121 json_object_object_add(object, "transform",
124 json_object_new_string( 122 json_object_new_string(
125 ipc_json_get_output_transform(wlr_output->transform))); 123 ipc_json_get_output_transform(wlr_output->transform)));
@@ -148,6 +146,8 @@ static void ipc_json_describe_output(struct sway_output *output,
148 json_object_new_int(wlr_output->width)); 146 json_object_new_int(wlr_output->width));
149 json_object_object_add(current_mode_object, "height", 147 json_object_object_add(current_mode_object, "height",
150 json_object_new_int(wlr_output->height)); 148 json_object_new_int(wlr_output->height));
149 json_object_object_add(current_mode_object, "refresh",
150 json_object_new_int(wlr_output->refresh));
151 json_object_object_add(object, "current_mode", current_mode_object); 151 json_object_object_add(object, "current_mode", current_mode_object);
152 152
153 struct sway_node *parent = node_get_parent(&output->node); 153 struct sway_node *parent = node_get_parent(&output->node);
diff --git a/swaymsg/main.c b/swaymsg/main.c
index e13dd7ec..663518f6 100644
--- a/swaymsg/main.c
+++ b/swaymsg/main.c
@@ -163,28 +163,28 @@ static void pretty_print_seat(json_object *i) {
163} 163}
164 164
165static void pretty_print_output(json_object *o) { 165static void pretty_print_output(json_object *o) {
166 json_object *name, *rect, *focused, *active, *ws; 166 json_object *name, *rect, *focused, *active, *ws, *current_mode;
167 json_object_object_get_ex(o, "name", &name); 167 json_object_object_get_ex(o, "name", &name);
168 json_object_object_get_ex(o, "rect", &rect); 168 json_object_object_get_ex(o, "rect", &rect);
169 json_object_object_get_ex(o, "focused", &focused); 169 json_object_object_get_ex(o, "focused", &focused);
170 json_object_object_get_ex(o, "active", &active); 170 json_object_object_get_ex(o, "active", &active);
171 json_object_object_get_ex(o, "current_workspace", &ws); 171 json_object_object_get_ex(o, "current_workspace", &ws);
172 json_object *make, *model, *serial, *scale, *refresh, *transform; 172 json_object *make, *model, *serial, *scale, *transform;
173 json_object_object_get_ex(o, "make", &make); 173 json_object_object_get_ex(o, "make", &make);
174 json_object_object_get_ex(o, "model", &model); 174 json_object_object_get_ex(o, "model", &model);
175 json_object_object_get_ex(o, "serial", &serial); 175 json_object_object_get_ex(o, "serial", &serial);
176 json_object_object_get_ex(o, "scale", &scale); 176 json_object_object_get_ex(o, "scale", &scale);
177 json_object_object_get_ex(o, "refresh", &refresh);
178 json_object_object_get_ex(o, "transform", &transform); 177 json_object_object_get_ex(o, "transform", &transform);
179 json_object *x, *y, *width, *height; 178 json_object *x, *y;
180 json_object_object_get_ex(rect, "x", &x); 179 json_object_object_get_ex(rect, "x", &x);
181 json_object_object_get_ex(rect, "y", &y); 180 json_object_object_get_ex(rect, "y", &y);
182 json_object_object_get_ex(rect, "width", &width);
183 json_object_object_get_ex(rect, "height", &height);
184 json_object *modes; 181 json_object *modes;
185 json_object_object_get_ex(o, "modes", &modes); 182 json_object_object_get_ex(o, "modes", &modes);
186 json_object *current_mode; 183 json_object *width, *height, *refresh;
187 json_object_object_get_ex(o, "current_mode", &current_mode); 184 json_object_object_get_ex(o, "current_mode", &current_mode);
185 json_object_object_get_ex(current_mode, "width", &width);
186 json_object_object_get_ex(current_mode, "height", &height);
187 json_object_object_get_ex(current_mode, "refresh", &refresh);
188 188
189 if (json_object_get_boolean(active)) { 189 if (json_object_get_boolean(active)) {
190 printf( 190 printf(
@@ -199,10 +199,8 @@ static void pretty_print_output(json_object *o) {
199 json_object_get_string(model), 199 json_object_get_string(model),
200 json_object_get_string(serial), 200 json_object_get_string(serial),
201 json_object_get_boolean(focused) ? " (focused)" : "", 201 json_object_get_boolean(focused) ? " (focused)" : "",
202 json_object_get_int( 202 json_object_get_int(width),
203 json_object_object_get(current_mode, "width")), 203 json_object_get_int(height),
204 json_object_get_int(
205 json_object_object_get(current_mode, "height")),
206 (float)json_object_get_int(refresh) / 1000, 204 (float)json_object_get_int(refresh) / 1000,
207 json_object_get_int(x), json_object_get_int(y), 205 json_object_get_int(x), json_object_get_int(y),
208 json_object_get_double(scale), 206 json_object_get_double(scale),