Bugfix: Show scratchpad on the correct output (+test)

Fixes: #596
This commit is contained in:
Michael Stapelberg
2012-01-07 16:53:37 +00:00
parent 89dded044b
commit 3254188cda
3 changed files with 126 additions and 2 deletions

View File

@ -108,8 +108,10 @@ void scratchpad_show(Con *con) {
Con *output = con_get_output(con);
con->rect.width = output->rect.width * 0.5;
con->rect.height = output->rect.height * 0.75;
con->rect.x = (output->rect.width / 2.0) - (con->rect.width / 2.0);
con->rect.y = (output->rect.height / 2.0) - (con->rect.height / 2.0);
con->rect.x = output->rect.x +
((output->rect.width / 2.0) - (con->rect.width / 2.0));
con->rect.y = output->rect.y +
((output->rect.height / 2.0) - (con->rect.height / 2.0));
con->scratchpad_state = SCRATCHPAD_CHANGED;
}