Hello, The FP3232_TO_DOUBLE(x) is declared in XExtInt.c as: #define FP3232_TO_DOUBLE(x) ((double) (x).integral + (x).frac / (1ULL << 32)) The (x).frac is integer and (1ULL << 32) is also integer, to the result is also integer and zero. The proposed fix is to convert (x).frac to double: #define FP3232_TO_DOUBLE(x) ((double) (x).integral + (double) (x).frac / (1ULL << 32)) Also the fractional values are ignored in copy_classes function and there is a /* FIXME: fractional parts */ there. The fix is trivial: Instead of: cls_lib->min = cls_wire->min.integral; cls_lib->max = cls_wire->max.integral; cls_lib->value = cls_wire->value.integral; /* FIXME: fractional parts */ Could be replaced by: cls_lib->min = FP3232_TO_DOUBLE(cls_wire->min); cls_lib->max = FP3232_TO_DOUBLE(cls_wire->max); cls_lib->value = FP3232_TO_DOUBLE(cls_wire->value); This fixes glitchy scrolling in Qt applications when the application was just activated or was scrolled in the backgroud. Qt is using XIQueryDevice call to synchronize internal scroll location with an actual one (QXcbConnection::xi2HandleDeviceChangedEvent and QXcbConnection::updateScrollingDevice functions in http://code.qt.io/cgit/qt/qtbase.git/tree/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp) The patch is attached Best, Alexander Bersenev
Created attachment 139786 [details] [review] The patch
https://www.youtube.com/watch?v=PYDa05QKD_8 - the demonstration of scrolling glitches in Qt programs
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xorg/lib/libxi/issues/10.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.