Skip to content
Commit c441ce5c authored by Yifan Zhu's avatar Yifan Zhu
Browse files

Avoid accidental mixing of qreal and int

The code for placeSmart uses ints to store coordinates and dimensions,
but the various methods of QRectF return qreal types, which can be
non-integers under fractional scaling, causing multiple issues.

This commit explicitly converts the needed quantities to ints,
avoiding the issues.

Previously, the code relied on the assumption that
y = area.y() + area.height(); implies !(y < area.y() + area.height()).
This doesn't always hold when mixing qreals and ints, causing infinite loops
under fractional scaling when attempting to open large windows, as
reported in BUG 477820.

This commit also extends the fix in 5502ce9a to fractional scaling scenarios.
The ceiling of client widths and height is used, instead of the implicit
floor, which caused BUG 477886.

BUG: 477820
BUG: 477886
parent e28ec8ad
Pipeline #548295 passed with stage
in 8 minutes and 26 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