aboutsummaryrefslogtreecommitdiff
path: root/sway/commands/rename.c
diff options
context:
space:
mode:
authorRyan Dwyer <ryandwyer1@gmail.com>2018-12-18 21:59:20 +1000
committeremersion <contact@emersion.fr>2018-12-18 14:00:39 +0100
commit3a4f4f5d6699d064845f715a849a6ab824a734b6 (patch)
tree93d3efa138c3e23d64f9642b868e4b1b6242bf5f /sway/commands/rename.c
parente726b5c4458a88a3bd8880dca150f2de5c266a22 (diff)
Return success when renaming a workspace to itself
Diffstat (limited to 'sway/commands/rename.c')
-rw-r--r--sway/commands/rename.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sway/commands/rename.c b/sway/commands/rename.c
index 29f90d81..491dbab0 100644
--- a/sway/commands/rename.c
+++ b/sway/commands/rename.c
@@ -81,8 +81,12 @@ struct cmd_results *cmd_rename(int argc, char **argv) {
struct sway_workspace *tmp_workspace = workspace_by_name(new_name);
if (tmp_workspace) {
free(new_name);
- return cmd_results_new(CMD_INVALID, "rename",
- "Workspace already exists");
+ if (tmp_workspace == workspace) {
+ return cmd_results_new(CMD_SUCCESS, NULL, NULL);
+ } else {
+ return cmd_results_new(CMD_INVALID, "rename",
+ "Workspace already exists");
+ }
}
wlr_log(WLR_DEBUG, "renaming workspace '%s' to '%s'", workspace->name, new_name);