aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-02-04 22:56:20 -0500
committerGitHub <noreply@github.com>2018-02-04 22:56:20 -0500
commitb10269e513a0bf29059a7203aa8e3ccac10f0af4 (patch)
tree89daa0e7f183fef936979dc94af78af4fb6d460c
parentd33a113f6715cd3dcf96062ca6b11c79f3b59dcb (diff)
parent8dcb2f2d6bf9c2ffb202c9b7f8b9e5e6aeea3f05 (diff)
Merge pull request #607 from VincentVanlaer/cursor-bug
Prevent cursor from getting stuck at infinity
-rw-r--r--types/wlr_output_layout.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/types/wlr_output_layout.c b/types/wlr_output_layout.c
index b01fb840..46b0bd2a 100644
--- a/types/wlr_output_layout.c
+++ b/types/wlr_output_layout.c
@@ -327,7 +327,11 @@ void wlr_output_layout_closest_point(struct wlr_output_layout *layout,
output_distance =
(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_y = output_y;
min_distance = output_distance;