mirror of
https://github.com/swaywm/sway.git
synced 2025-11-03 09:01:43 -05:00
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
This commit is contained in:
parent
cd8b4ace92
commit
200833caae
3 changed files with 20 additions and 0 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue