Merge pull request #1539 from mh21/wsrename-1527
Rename workspaces in startup sequences
This commit is contained in:
commit
56f420c3dd
|
@ -44,6 +44,12 @@ void startup_sequence_delete(struct Startup_Sequence *sequence);
|
||||||
*/
|
*/
|
||||||
void startup_monitor_event(SnMonitorEvent *event, void *userdata);
|
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);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the stored startup sequence for the _NET_STARTUP_ID of a given window.
|
* Gets the stored startup sequence for the _NET_STARTUP_ID of a given window.
|
||||||
*
|
*
|
||||||
|
|
|
@ -1934,6 +1934,8 @@ void cmd_rename_workspace(I3_CMD, char *old_name, char *new_name) {
|
||||||
ewmh_update_desktop_names();
|
ewmh_update_desktop_names();
|
||||||
ewmh_update_desktop_viewport();
|
ewmh_update_desktop_viewport();
|
||||||
ewmh_update_current_desktop();
|
ewmh_update_current_desktop();
|
||||||
|
|
||||||
|
startup_sequence_rename_workspace(old_name, new_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -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.
|
* Gets the stored startup sequence for the _NET_STARTUP_ID of a given window.
|
||||||
*
|
*
|
||||||
|
|
|
@ -142,12 +142,17 @@ is_num_children($first_ws, 2, 'two containers on the first workspace');
|
||||||
complete_startup();
|
complete_startup();
|
||||||
sync_with_i3;
|
sync_with_i3;
|
||||||
|
|
||||||
|
# even when renaming the workspace, windows should end up on the correct one
|
||||||
|
cmd "rename workspace $first_ws to temp";
|
||||||
|
|
||||||
# Startup has completed but the 30-second deletion time hasn't elapsed,
|
# Startup has completed but the 30-second deletion time hasn't elapsed,
|
||||||
# so this window should still go on the leader's initial workspace.
|
# so this window should still go on the leader's initial workspace.
|
||||||
$win = open_window({ dont_map => 1, client_leader => $leader });
|
$win = open_window({ dont_map => 1, client_leader => $leader });
|
||||||
$win->map;
|
$win->map;
|
||||||
sync_with_i3;
|
sync_with_i3;
|
||||||
|
|
||||||
|
cmd "rename workspace temp to $first_ws";
|
||||||
|
|
||||||
is_num_children($first_ws, 3, 'three containers on the first workspace');
|
is_num_children($first_ws, 3, 'three containers on the first workspace');
|
||||||
|
|
||||||
# Switch to the first workspace and move the focused window to the
|
# Switch to the first workspace and move the focused window to the
|
||||||
|
|
Loading…
Reference in New Issue