Rename workspaces in startup sequences.

When renaming workspaces, any workspace names in pending startup
sequences also need to be renamed.
This commit is contained in:
Michael Hofmann
2015-03-07 00:13:54 +01:00
parent 5776edcc84
commit 44f748a663
3 changed files with 24 additions and 0 deletions

View File

@ -257,6 +257,22 @@ void startup_monitor_event(SnMonitorEvent *event, void *userdata) {
}
}
/**
* Renames workspaces that are mentioned in the startup sequences.
*
*/
void startup_sequence_rename_workspace(char *old_name, char *new_name) {
struct Startup_Sequence *current;
TAILQ_FOREACH(current, &startup_sequences, sequences) {
if (strcmp(current->workspace, old_name) != 0)
continue;
DLOG("Renaming workspace \"%s\" to \"%s\" in startup sequence %s.\n",
old_name, new_name, current->id);
free(current->workspace);
current->workspace = sstrdup(new_name);
}
}
/**
* Gets the stored startup sequence for the _NET_STARTUP_ID of a given window.
*