aboutsummaryrefslogtreecommitdiffstats
path: root/sway/ipc-json.c
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-05-24 22:30:44 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-06-01 23:14:58 +1000
commit1f2e399ade77070a2d0b82856ad9a3eef96b8676 (patch)
treec469197e140051aea912cb173723c7e55ce1e410 /sway/ipc-json.c
parentSend frame done to floating views (diff)
downloadsway-1f2e399ade77070a2d0b82856ad9a3eef96b8676.tar.gz
sway-1f2e399ade77070a2d0b82856ad9a3eef96b8676.tar.zst
sway-1f2e399ade77070a2d0b82856ad9a3eef96b8676.zip
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 da4bef60..4d7024a8 100644
--- a/sway/ipc-json.c
+++ b/sway/ipc-json.c
@@ -4,6 +4,7 @@
4#include "log.h" 4#include "log.h"
5#include "sway/ipc-json.h" 5#include "sway/ipc-json.h"
6#include "sway/tree/container.h" 6#include "sway/tree/container.h"
7#include "sway/tree/workspace.h"
7#include "sway/output.h" 8#include "sway/output.h"
8#include "sway/input/input-manager.h" 9#include "sway/input/input-manager.h"
9#include "sway/input/seat.h" 10#include "sway/input/seat.h"
@@ -150,6 +151,15 @@ static void ipc_json_describe_workspace(struct sway_container *workspace,
150 151
151 const char *layout = ipc_json_layout_description(workspace->layout); 152 const char *layout = ipc_json_layout_description(workspace->layout);
152 json_object_object_add(object, "layout", json_object_new_string(layout)); 153 json_object_object_add(object, "layout", json_object_new_string(layout));
154
155 // Floating
156 json_object *floating_array = json_object_new_array();
157 struct sway_container *floating = workspace->sway_workspace->floating;
158 for (int i = 0; i < floating->children->length; ++i) {
159 struct sway_container *floater = floating->children->items[i];
160 json_object_array_add(floating_array, ipc_json_describe_container_recursive(floater));
161 }
162 json_object_object_add(object, "floating_nodes", floating_array);
153} 163}
154 164
155static void ipc_json_describe_view(struct sway_container *c, json_object *object) { 165static void ipc_json_describe_view(struct sway_container *c, json_object *object) {