fixes #776
this implements both the "move container to workspace back_and_forth" command and movements to the same workspace when auto_back_and_forth is set. it includes documentation and test suite additions by michael. it also simplifies the workspace_show_by_name function (making use of workspace_get accepting NULL pointers).
This commit is contained in:
committed by
Michael Stapelberg
parent
a01bac13fe
commit
e15e37f922
@ -392,8 +392,7 @@ void workspace_show(Con *workspace) {
|
||||
*/
|
||||
void workspace_show_by_name(const char *num) {
|
||||
Con *workspace;
|
||||
bool changed_num_workspaces;
|
||||
workspace = workspace_get(num, &changed_num_workspaces);
|
||||
workspace = workspace_get(num, NULL);
|
||||
_workspace_show(workspace);
|
||||
}
|
||||
|
||||
@ -664,6 +663,22 @@ void workspace_back_and_forth(void) {
|
||||
workspace_show_by_name(previous_workspace_name);
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns the previously focused workspace con, or NULL if unavailable.
|
||||
*
|
||||
*/
|
||||
Con *workspace_back_and_forth_get(void) {
|
||||
if (!previous_workspace_name) {
|
||||
DLOG("no previous workspace name set.");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Con *workspace;
|
||||
workspace = workspace_get(previous_workspace_name, NULL);
|
||||
|
||||
return workspace;
|
||||
}
|
||||
|
||||
static bool get_urgency_flag(Con *con) {
|
||||
Con *child;
|
||||
TAILQ_FOREACH(child, &(con->nodes_head), nodes)
|
||||
|
Reference in New Issue
Block a user