Merge branch 'fix-floating-negative'

This commit is contained in:
Michael Stapelberg 2011-08-24 22:43:25 +02:00
commit 3690bc6eef
1 changed files with 2 additions and 2 deletions

View File

@ -146,8 +146,8 @@ void floating_enable(Con *con, bool automatic) {
nc->rect.x, nc->rect.y); nc->rect.x, nc->rect.y);
/* Take the relative coordinates of the current output, then add them /* Take the relative coordinates of the current output, then add them
* to the coordinate space of the correct output */ * to the coordinate space of the correct output */
uint32_t rel_x = (nc->rect.x - current_output->con->rect.x); uint32_t rel_x = (nc->rect.x - (current_output ? current_output->con->rect.x : 0));
uint32_t rel_y = (nc->rect.y - current_output->con->rect.y); uint32_t rel_y = (nc->rect.y - (current_output ? current_output->con->rect.y : 0));
nc->rect.x = correct_output->rect.x + rel_x; nc->rect.x = correct_output->rect.x + rel_x;
nc->rect.y = correct_output->rect.y + rel_y; nc->rect.y = correct_output->rect.y + rel_y;
} }