Protect "move position mouse" against a NULL access.

This could happen if two outputs are set up to have a gap in between them and the mouse cursor
being in said gap when the command is triggered.
This commit is contained in:
Ingo Bürk 2015-05-14 13:07:56 -04:00
parent fbbe9cf2e8
commit 8801de2399
1 changed files with 4 additions and 0 deletions

View File

@ -440,6 +440,10 @@ void floating_move_to_pointer(Con *con) {
} }
Output *output = get_output_containing(reply->root_x, reply->root_y); Output *output = get_output_containing(reply->root_x, reply->root_y);
if (output == NULL) {
ELOG("The pointer is not on any output, cannot move the container here.");
return;
}
/* Determine where to put the window. */ /* Determine where to put the window. */
int32_t x = reply->root_x - con->rect.width / 2; int32_t x = reply->root_x - con->rect.width / 2;