Skip to content
Commit eb6e7ded authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

Make Workspace::outputAt() more robust to extreme values

Since QPointF can have values that exceed INT_MAX, "distance <
minDistance" may not be triggered for the first output.

In order to make Workspace::outputAt() more robust to such extreme
cases, this patch changes the type of minDistance from int to qreal to
avoid truncation and adds an explicit check to initialize bestOutput
when we see the first workspace output.

It would be also great to add size hints sanitization code in kwin, but
it can be done later.

BUG: 460446

---

Should close:

* https://errors-eval.kde.org/organizations/kde/issues/321
* https://errors-eval.kde.org/organizations/kde/issues/341


(cherry picked from commit 28899df4)
parent 44d3e436
Pipeline #249394 failed with stage
in 12 minutes and 56 seconds
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment