xcbutils: arm x apps can't be dragged to a negative position on the screen

the behavior of converting negative floating-point numbers to unsigned
integers is undefined. It is necessary to keep the conversion behavior
consistent between ARM and x86 platforms.

through the above conversions, all become the two's complement of
negative numbers.

Signed-off-by: zorowk <near.kingzero@gmail.com>
wilder/Plasma/6.2
zoro wk 2 years ago committed by Vlad Zahorodnii
parent 648cfcd66c
commit 904c33556b
  1. 2
      src/utils/xcbutils.cpp

@ -621,7 +621,7 @@ uint32_t toXNative(qreal value)
if (!qFuzzyIsNull(std::fmod(kwinApp()->xwaylandScale() * value, 1))) {
qCDebug(KWIN_CORE) << "precision lost! floating value sent to X" << kwinApp()->xwaylandScale() * value;
}
return std::round(kwinApp()->xwaylandScale() * value);
return static_cast<int32_t>(std::round(kwinApp()->xwaylandScale() * value));
}
QRect toXNative(const QRectF &r)

Loading…
Cancel
Save