Call scratchpad_show() when focusing scratchpad windows via criteria

fixes #931
This commit is contained in:
Michael Stapelberg 2013-01-25 16:10:37 +01:00
parent 2ea94420d3
commit 74558bb33d
1 changed files with 11 additions and 0 deletions

View File

@ -1410,6 +1410,7 @@ void cmd_focus(I3_CMD) {
return; return;
} }
Con *__i3_scratch = workspace_get("__i3_scratch", NULL);
int count = 0; int count = 0;
owindow *current; owindow *current;
TAILQ_FOREACH(current, &owindows, owindows) { TAILQ_FOREACH(current, &owindows, owindows) {
@ -1426,6 +1427,16 @@ void cmd_focus(I3_CMD) {
return; return;
} }
/* In case this is a scratchpad window, call scratchpad_show(). */
if (ws == __i3_scratch) {
scratchpad_show(current->con);
count++;
/* While for the normal focus case we can change focus multiple
* times and only a single window ends up focused, we could show
* multiple scratchpad windows. So, rather break here. */
break;
}
/* If the container is not on the current workspace, /* If the container is not on the current workspace,
* workspace_show() will switch to a different workspace and (if * workspace_show() will switch to a different workspace and (if
* enabled) trigger a mouse pointer warp to the currently focused * enabled) trigger a mouse pointer warp to the currently focused