aboutsummaryrefslogtreecommitdiff
path: root/sway/tree/root.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/tree/root.c')
-rw-r--r--sway/tree/root.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/sway/tree/root.c b/sway/tree/root.c
index 0744192b..5dde9f22 100644
--- a/sway/tree/root.c
+++ b/sway/tree/root.c
@@ -390,3 +390,17 @@ void root_get_box(struct sway_root *root, struct wlr_box *box) {
box->width = root->width;
box->height = root->height;
}
+
+void root_rename_pid_workspaces(const char *old_name, const char *new_name) {
+ if (!pid_workspaces.prev && !pid_workspaces.next) {
+ wl_list_init(&pid_workspaces);
+ }
+
+ struct pid_workspace *pw = NULL;
+ wl_list_for_each(pw, &pid_workspaces, link) {
+ if (strcmp(pw->workspace, old_name) == 0) {
+ free(pw->workspace);
+ pw->workspace = strdup(new_name);
+ }
+ }
+}