aboutsummaryrefslogtreecommitdiff
path: root/sway/commands
diff options
context:
space:
mode:
authormliszcz <liszcz.michal@gmail.com>2019-03-23 11:32:44 +0100
committerBrian Ashworth <bosrsf04@gmail.com>2019-03-23 17:49:27 -0400
commit200833caaea36dd65324e5460520731f5c98ff8a (patch)
treec0ecf9b611435f19a62682a0ee0feb564aa29acb /sway/commands
parentcd8b4ace926bd5a5289a5d5d6f6dddc1e4732287 (diff)
downloadsway-200833caaea36dd65324e5460520731f5c98ff8a.tar.xz
Allow for workspace renaming during exec handling
This change adds support for renaming a workspace when `exec` command is being processed by keeping sway_workspace and pid_workspace names in sync. The change can be verified by running following command: swaymsg exec <application>; swaymsg rename workspace number 1 to 5 Fixes: #3952
Diffstat (limited to 'sway/commands')
-rw-r--r--sway/commands/rename.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sway/commands/rename.c b/sway/commands/rename.c
index 88377b09..3b855fdf 100644
--- a/sway/commands/rename.c
+++ b/sway/commands/rename.c
@@ -9,6 +9,7 @@
#include "sway/output.h"
#include "sway/tree/container.h"
#include "sway/tree/workspace.h"
+#include "sway/tree/root.h"
static const char expected_syntax[] =
"Expected 'rename workspace <old_name> to <new_name>' or "
@@ -89,6 +90,9 @@ struct cmd_results *cmd_rename(int argc, char **argv) {
}
sway_log(SWAY_DEBUG, "renaming workspace '%s' to '%s'", workspace->name, new_name);
+
+ root_rename_pid_workspaces(workspace->name, new_name);
+
free(workspace->name);
workspace->name = new_name;