aboutsummaryrefslogtreecommitdiff
path: root/sway
diff options
context:
space:
mode:
authorRyan Dwyer <ryandwyer1@gmail.com>2018-05-29 17:42:11 +1000
committerRyan Dwyer <ryandwyer1@gmail.com>2018-05-29 17:42:11 +1000
commit6f4cb2b29d5a708d58a88c40ed6cc01bf471a8f0 (patch)
tree5aa498b0d4ec3a215a3ea70f082e6ab1d9f361f2 /sway
parent3482eebaca090bff110199d5e00e59b4be376ff8 (diff)
downloadsway-6f4cb2b29d5a708d58a88c40ed6cc01bf471a8f0.tar.xz
Add tree representation to IPC workspace description
Diffstat (limited to 'sway')
-rw-r--r--sway/ipc-json.c2
-rw-r--r--sway/tree/container.c10
2 files changed, 8 insertions, 4 deletions
diff --git a/sway/ipc-json.c b/sway/ipc-json.c
index ad37216f..0233a36e 100644
--- a/sway/ipc-json.c
+++ b/sway/ipc-json.c
@@ -147,6 +147,8 @@ static void ipc_json_describe_workspace(struct sway_container *workspace,
json_object_new_string(workspace->parent->name) : NULL);
json_object_object_add(object, "type", json_object_new_string("workspace"));
json_object_object_add(object, "urgent", json_object_new_boolean(false));
+ json_object_object_add(object, "representation", workspace->formatted_title ?
+ json_object_new_string(workspace->formatted_title) : NULL);
const char *layout = ipc_json_layout_description(workspace->layout);
json_object_object_add(object, "layout", json_object_new_string(layout));
diff --git a/sway/tree/container.c b/sway/tree/container.c
index 59137d88..33d88d7f 100644
--- a/sway/tree/container.c
+++ b/sway/tree/container.c
@@ -842,7 +842,7 @@ static size_t get_tree_representation(struct sway_container *parent, char *buffe
}
void container_notify_subtree_changed(struct sway_container *container) {
- if (!container || container->type != C_CONTAINER) {
+ if (!container || container->type < C_WORKSPACE) {
return;
}
free(container->formatted_title);
@@ -856,9 +856,11 @@ void container_notify_subtree_changed(struct sway_container *container) {
get_tree_representation(container, buffer);
container->formatted_title = buffer;
- container_calculate_title_height(container);
- container_update_title_textures(container);
- container_notify_subtree_changed(container->parent);
+ if (container->type != C_WORKSPACE) {
+ container_calculate_title_height(container);
+ container_update_title_textures(container);
+ container_notify_subtree_changed(container->parent);
+ }
}
size_t container_titlebar_height() {