maybe_back_and_forth now sets render_tree

This commit is contained in:
Ondrej Grover 2012-05-02 22:27:41 +02:00 committed by Michael Stapelberg
parent 42dcb4e8c4
commit edae08a4d9
1 changed files with 10 additions and 8 deletions

View File

@ -82,7 +82,7 @@ static Output *get_output_from_string(Output *current_output, const char *output
* and return true, signaling that no further workspace switching should occur in the calling function.
*
*/
static bool maybe_back_and_forth(char *name) {
static bool maybe_back_and_forth(struct CommandResult *cmd_output, char *name) {
Con *ws = con_get_workspace(focused);
/* If we switched to a different workspace, do nothing */
@ -90,8 +90,10 @@ static bool maybe_back_and_forth(char *name) {
return false;
DLOG("This workspace is already focused.\n");
if (config.workspace_auto_back_and_forth)
if (config.workspace_auto_back_and_forth) {
workspace_back_and_forth();
cmd_output->needs_tree_render = true;
}
return true;
}
@ -802,13 +804,13 @@ void cmd_workspace_number(I3_CMD, char *which) {
ysuccess(true);
/* terminate the which string after the endposition of the number */
*endptr = '\0';
if (maybe_back_and_forth(which))
if (maybe_back_and_forth(cmd_output, which))
return;
workspace_show_by_name(which);
cmd_output->needs_tree_render = true;
return;
}
if (maybe_back_and_forth(which))
if (maybe_back_and_forth(cmd_output, which))
return;
workspace_show(workspace);
@ -841,7 +843,7 @@ void cmd_workspace_name(I3_CMD, char *name) {
}
DLOG("should switch to workspace %s\n", name);
if (maybe_back_and_forth(name))
if (maybe_back_and_forth(cmd_output, name))
return;
workspace_show_by_name(name);