From 74558bb33d1a4d6d66cda91bf0cce9b7434f3196 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Fri, 25 Jan 2013 16:10:37 +0100 Subject: [PATCH] Call scratchpad_show() when focusing scratchpad windows via criteria fixes #931 --- src/commands.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/commands.c b/src/commands.c index 323c5ae4..f39f311a 100644 --- a/src/commands.c +++ b/src/commands.c @@ -1410,6 +1410,7 @@ void cmd_focus(I3_CMD) { return; } + Con *__i3_scratch = workspace_get("__i3_scratch", NULL); int count = 0; owindow *current; TAILQ_FOREACH(current, &owindows, owindows) { @@ -1426,6 +1427,16 @@ void cmd_focus(I3_CMD) { 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, * workspace_show() will switch to a different workspace and (if * enabled) trigger a mouse pointer warp to the currently focused