Merge pull request #607 from VincentVanlaer/cursor-bug

Prevent cursor from getting stuck at infinity
This commit is contained in:
Drew DeVault 2018-02-04 22:56:20 -05:00 committed by GitHub
commit b10269e513
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -327,7 +327,11 @@ void wlr_output_layout_closest_point(struct wlr_output_layout *layout,
output_distance = output_distance =
(x - output_x) * (x - output_x) + (y - output_y) * (y - output_y); (x - output_x) * (x - output_x) + (y - output_y) * (y - output_y);
if (output_distance < min_distance) { if (!isfinite(output_distance)) {
output_distance = DBL_MAX;
}
if (output_distance <= min_distance) {
min_x = output_x; min_x = output_x;
min_y = output_y; min_y = output_y;
min_distance = output_distance; min_distance = output_distance;