Make "scratchpad show" return correct info

Fix the issue #3227(https://github.com/i3/i3/issues/3227).

1).Make cmd_scratchpad_show() use the information coming from scratchpad_show().
2).Add a test case 298-scratchpad-show.t.
This commit is contained in:
hwangcc23
2018-04-07 00:00:38 +08:00
parent a92acadfc0
commit 4869becfee
4 changed files with 61 additions and 12 deletions

View File

@ -1825,19 +1825,20 @@ void cmd_move_scratchpad(I3_CMD) {
void cmd_scratchpad_show(I3_CMD) {
DLOG("should show scratchpad window\n");
owindow *current;
bool result = false;
if (match_is_empty(current_match)) {
scratchpad_show(NULL);
result = scratchpad_show(NULL);
} else {
TAILQ_FOREACH(current, &owindows, owindows) {
DLOG("matching: %p / %s\n", current->con, current->con->name);
scratchpad_show(current->con);
result |= scratchpad_show(current->con);
}
}
cmd_output->needs_tree_render = true;
// XXX: default reply for now, make this a better reply
ysuccess(true);
ysuccess(result);
}
/*