aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2016-09-18 12:10:34 +0900
committerLibravatar GitHub <noreply@github.com>2016-09-18 12:10:34 +0900
commit043640820f4fdb7ea00bde6676b3b059f9b05c42 (patch)
tree93f63cf74bc4d336df6adcb19138f408a12d37a5
parentMerge pull request #904 from zandrmartin/fix-json-tree-focus-property (diff)
parentfix get_workspaces json reply (diff)
downloadsway-043640820f4fdb7ea00bde6676b3b059f9b05c42.tar.gz
sway-043640820f4fdb7ea00bde6676b3b059f9b05c42.tar.zst
sway-043640820f4fdb7ea00bde6676b3b059f9b05c42.zip
Merge pull request #907 from zandrmartin/fix-json-tree-focus-property
fix get_workspaces json reply
-rw-r--r--sway/ipc-server.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sway/ipc-server.c b/sway/ipc-server.c
index 70007f57..4c54e56a 100644
--- a/sway/ipc-server.c
+++ b/sway/ipc-server.c
@@ -512,7 +512,13 @@ bool ipc_send_reply(struct ipc_client *client, const char *payload, uint32_t pay
512 512
513void ipc_get_workspaces_callback(swayc_t *workspace, void *data) { 513void ipc_get_workspaces_callback(swayc_t *workspace, void *data) {
514 if (workspace->type == C_WORKSPACE) { 514 if (workspace->type == C_WORKSPACE) {
515 json_object_array_add((json_object *)data, ipc_json_describe_container(workspace)); 515 json_object *workspace_json = ipc_json_describe_container(workspace);
516 // override the default focused indicator because
517 // it's set differently for the get_workspaces reply
518 bool focused = root_container.focused == workspace->parent && workspace->parent->focused == workspace;
519 json_object_object_del(workspace_json, "focused");
520 json_object_object_add(workspace_json, "focused", json_object_new_boolean(focused));
521 json_object_array_add((json_object *)data, workspace_json);
516 } 522 }
517} 523}
518 524