diff options
author | 2016-09-17 16:36:55 -0500 | |
---|---|---|
committer | 2016-09-17 16:36:55 -0500 | |
commit | 87080bb9cc5c9fdf9b2bf4cd0257e77231d257ed (patch) | |
tree | bb9efb20f171de177d7a8924b74df96ac2ceb5fc /sway | |
parent | Merge pull request #906 from zandrmartin/global-focus-pointer (diff) | |
download | sway-87080bb9cc5c9fdf9b2bf4cd0257e77231d257ed.tar.gz sway-87080bb9cc5c9fdf9b2bf4cd0257e77231d257ed.tar.zst sway-87080bb9cc5c9fdf9b2bf4cd0257e77231d257ed.zip |
take four!
Diffstat (limited to 'sway')
-rw-r--r-- | sway/ipc-json.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/sway/ipc-json.c b/sway/ipc-json.c index 3f03b9f1..5d10ff59 100644 --- a/sway/ipc-json.c +++ b/sway/ipc-json.c | |||
@@ -132,11 +132,9 @@ static void ipc_json_describe_output(swayc_t *output, json_object *object) { | |||
132 | 132 | ||
133 | static void ipc_json_describe_workspace(swayc_t *workspace, json_object *object) { | 133 | static void ipc_json_describe_workspace(swayc_t *workspace, json_object *object) { |
134 | int num = (isdigit(workspace->name[0])) ? atoi(workspace->name) : -1; | 134 | int num = (isdigit(workspace->name[0])) ? atoi(workspace->name) : -1; |
135 | bool focused = root_container.focused == workspace->parent && workspace->parent->focused == workspace; | ||
136 | const char *layout = ipc_json_layout_description(workspace->layout); | 135 | const char *layout = ipc_json_layout_description(workspace->layout); |
137 | 136 | ||
138 | json_object_object_add(object, "num", json_object_new_int(num)); | 137 | json_object_object_add(object, "num", json_object_new_int(num)); |
139 | json_object_object_add(object, "focused", json_object_new_boolean(focused)); | ||
140 | json_object_object_add(object, "output", (workspace->parent) ? json_object_new_string(workspace->parent->name) : NULL); | 138 | json_object_object_add(object, "output", (workspace->parent) ? json_object_new_string(workspace->parent->name) : NULL); |
141 | json_object_object_add(object, "urgent", json_object_new_boolean(false)); | 139 | json_object_object_add(object, "urgent", json_object_new_boolean(false)); |
142 | json_object_object_add(object, "type", json_object_new_string("workspace")); | 140 | json_object_object_add(object, "type", json_object_new_string("workspace")); |
@@ -171,7 +169,6 @@ static void ipc_json_describe_view(swayc_t *c, json_object *object) { | |||
171 | json_object_object_add(object, "percent", (percent > 0) ? json_object_new_double(percent) : NULL); | 169 | json_object_object_add(object, "percent", (percent > 0) ? json_object_new_double(percent) : NULL); |
172 | // TODO: make urgency actually work once Sway supports it | 170 | // TODO: make urgency actually work once Sway supports it |
173 | json_object_object_add(object, "urgent", json_object_new_boolean(false)); | 171 | json_object_object_add(object, "urgent", json_object_new_boolean(false)); |
174 | json_object_object_add(object, "focused", json_object_new_boolean(c->is_focused)); | ||
175 | 172 | ||
176 | json_object_object_add(object, "layout", | 173 | json_object_object_add(object, "layout", |
177 | (strcmp(layout, "null") == 0) ? NULL : json_object_new_string(layout)); | 174 | (strcmp(layout, "null") == 0) ? NULL : json_object_new_string(layout)); |
@@ -219,6 +216,7 @@ json_object *ipc_json_describe_container(swayc_t *c) { | |||
219 | json_object_object_add(object, "name", (c->name) ? json_object_new_string(c->name) : NULL); | 216 | json_object_object_add(object, "name", (c->name) ? json_object_new_string(c->name) : NULL); |
220 | json_object_object_add(object, "rect", ipc_json_create_rect(c)); | 217 | json_object_object_add(object, "rect", ipc_json_create_rect(c)); |
221 | json_object_object_add(object, "visible", json_object_new_boolean(c->visible)); | 218 | json_object_object_add(object, "visible", json_object_new_boolean(c->visible)); |
219 | json_object_object_add(object, "focused", json_object_new_boolean(c == current_focus)); | ||
222 | 220 | ||
223 | switch (c->type) { | 221 | switch (c->type) { |
224 | case C_ROOT: | 222 | case C_ROOT: |