diff options
-rw-r--r-- | sway/ipc-json.c | 2 | ||||
-rw-r--r-- | sway/tree/container.c | 10 | ||||
-rw-r--r-- | swaymsg/main.c | 10 |
3 files changed, 15 insertions, 7 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, | |||
147 | json_object_new_string(workspace->parent->name) : NULL); | 147 | json_object_new_string(workspace->parent->name) : NULL); |
148 | json_object_object_add(object, "type", json_object_new_string("workspace")); | 148 | json_object_object_add(object, "type", json_object_new_string("workspace")); |
149 | json_object_object_add(object, "urgent", json_object_new_boolean(false)); | 149 | json_object_object_add(object, "urgent", json_object_new_boolean(false)); |
150 | json_object_object_add(object, "representation", workspace->formatted_title ? | ||
151 | json_object_new_string(workspace->formatted_title) : NULL); | ||
150 | 152 | ||
151 | const char *layout = ipc_json_layout_description(workspace->layout); | 153 | const char *layout = ipc_json_layout_description(workspace->layout); |
152 | json_object_object_add(object, "layout", json_object_new_string(layout)); | 154 | 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 | |||
842 | } | 842 | } |
843 | 843 | ||
844 | void container_notify_subtree_changed(struct sway_container *container) { | 844 | void container_notify_subtree_changed(struct sway_container *container) { |
845 | if (!container || container->type != C_CONTAINER) { | 845 | if (!container || container->type < C_WORKSPACE) { |
846 | return; | 846 | return; |
847 | } | 847 | } |
848 | free(container->formatted_title); | 848 | free(container->formatted_title); |
@@ -856,9 +856,11 @@ void container_notify_subtree_changed(struct sway_container *container) { | |||
856 | get_tree_representation(container, buffer); | 856 | get_tree_representation(container, buffer); |
857 | 857 | ||
858 | container->formatted_title = buffer; | 858 | container->formatted_title = buffer; |
859 | container_calculate_title_height(container); | 859 | if (container->type != C_WORKSPACE) { |
860 | container_update_title_textures(container); | 860 | container_calculate_title_height(container); |
861 | container_notify_subtree_changed(container->parent); | 861 | container_update_title_textures(container); |
862 | container_notify_subtree_changed(container->parent); | ||
863 | } | ||
862 | } | 864 | } |
863 | 865 | ||
864 | size_t container_titlebar_height() { | 866 | size_t container_titlebar_height() { |
diff --git a/swaymsg/main.c b/swaymsg/main.c index bf56b80d..8a53474b 100644 --- a/swaymsg/main.c +++ b/swaymsg/main.c | |||
@@ -53,24 +53,28 @@ static void pretty_print_cmd(json_object *r) { | |||
53 | } | 53 | } |
54 | 54 | ||
55 | static void pretty_print_workspace(json_object *w) { | 55 | static void pretty_print_workspace(json_object *w) { |
56 | json_object *name, *rect, *visible, *output, *urgent, *layout, *focused; | 56 | json_object *name, *rect, *visible, *output, *urgent, *layout, |
57 | *representation, *focused; | ||
57 | json_object_object_get_ex(w, "name", &name); | 58 | json_object_object_get_ex(w, "name", &name); |
58 | json_object_object_get_ex(w, "rect", &rect); | 59 | json_object_object_get_ex(w, "rect", &rect); |
59 | json_object_object_get_ex(w, "visible", &visible); | 60 | json_object_object_get_ex(w, "visible", &visible); |
60 | json_object_object_get_ex(w, "output", &output); | 61 | json_object_object_get_ex(w, "output", &output); |
61 | json_object_object_get_ex(w, "urgent", &urgent); | 62 | json_object_object_get_ex(w, "urgent", &urgent); |
62 | json_object_object_get_ex(w, "layout", &layout); | 63 | json_object_object_get_ex(w, "layout", &layout); |
64 | json_object_object_get_ex(w, "representation", &representation); | ||
63 | json_object_object_get_ex(w, "focused", &focused); | 65 | json_object_object_get_ex(w, "focused", &focused); |
64 | printf( | 66 | printf( |
65 | "Workspace %s%s%s%s\n" | 67 | "Workspace %s%s%s%s\n" |
66 | " Output: %s\n" | 68 | " Output: %s\n" |
67 | " Layout: %s\n\n", | 69 | " Layout: %s\n" |
70 | " Representation: %s\n\n", | ||
68 | json_object_get_string(name), | 71 | json_object_get_string(name), |
69 | json_object_get_boolean(focused) ? " (focused)" : "", | 72 | json_object_get_boolean(focused) ? " (focused)" : "", |
70 | !json_object_get_boolean(visible) ? " (off-screen)" : "", | 73 | !json_object_get_boolean(visible) ? " (off-screen)" : "", |
71 | json_object_get_boolean(urgent) ? " (urgent)" : "", | 74 | json_object_get_boolean(urgent) ? " (urgent)" : "", |
72 | json_object_get_string(output), | 75 | json_object_get_string(output), |
73 | json_object_get_string(layout) | 76 | json_object_get_string(layout), |
77 | json_object_get_string(representation) | ||
74 | ); | 78 | ); |
75 | } | 79 | } |
76 | 80 | ||