summaryrefslogtreecommitdiff
path: root/sway/ipc-json.c
diff options
context:
space:
mode:
authorDrew DeVault <[email protected]>2018-06-01 15:41:49 -0700
committerGitHub <[email protected]>2018-06-01 15:41:49 -0700
commit96446fdbf748acfdbd4c60fbc0d12e45a27199fe (patch)
tree6d46cc61a1e7c74efe36565796ccbf8b47e7e4a7 /sway/ipc-json.c
parentfd885d5779ef9aa408fa856a66fa7343ce01fa19 (diff)
parent70c2c504452eccbe5a74bc014e99b5b03db14124 (diff)
Merge pull request #2027 from RyanDwyer/implement-floating
Implement floating
Diffstat (limited to 'sway/ipc-json.c')
-rw-r--r--sway/ipc-json.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sway/ipc-json.c b/sway/ipc-json.c
index 03582950..6d185449 100644
--- a/sway/ipc-json.c
+++ b/sway/ipc-json.c
@@ -4,6 +4,7 @@
#include "log.h"
#include "sway/ipc-json.h"
#include "sway/tree/container.h"
+#include "sway/tree/workspace.h"
#include "sway/output.h"
#include "sway/input/input-manager.h"
#include "sway/input/seat.h"
@@ -152,6 +153,15 @@ static void ipc_json_describe_workspace(struct sway_container *workspace,
const char *layout = ipc_json_layout_description(workspace->layout);
json_object_object_add(object, "layout", json_object_new_string(layout));
+
+ // Floating
+ json_object *floating_array = json_object_new_array();
+ struct sway_container *floating = workspace->sway_workspace->floating;
+ for (int i = 0; i < floating->children->length; ++i) {
+ struct sway_container *floater = floating->children->items[i];
+ json_object_array_add(floating_array, ipc_json_describe_container_recursive(floater));
+ }
+ json_object_object_add(object, "floating_nodes", floating_array);
}
static void ipc_json_describe_view(struct sway_container *c, json_object *object) {