Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 691296 - dev-qt/qtgui-5.12.3-r1: mouse wheel does not work on big endian
Summary: dev-qt/qtgui-5.12.3-r1: mouse wheel does not work on big endian
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: PPC64 Linux
: Normal normal (vote)
Assignee: Qt Bug Alias
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2019-08-02 16:17 UTC by Marcus Comstedt
Modified: 2019-08-04 10:16 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Workaround for broken input mask handling in qxcbconnection_xi2.cpp (qt5_xi2_be_fix.patch,2.31 KB, patch)
2019-08-02 16:17 UTC, Marcus Comstedt
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Marcus Comstedt 2019-08-02 16:17:54 UTC
Created attachment 585508 [details, diff]
Workaround for broken input mask handling in qxcbconnection_xi2.cpp

Qt5 uses libxcb to set up input masks for XInput2.  However, it does not follow
the correct format for an input mask.  Because of this Qt will not get all the
events it wants resulting in the mouse wheel not being handled.

How to reproduce:
1) Run a Qt5 application on any big endian system supporting XInput
2) Try to use the mouse wheel

Actual behaviour:
* No mouse wheel events are sent to the application

Expected behaviour:
* Mouse wheel events are sent to the application

Details:

Input masks in XInput2 are arrays of bytes.  Xlib provides convenience
macros XISetMask(), XIClearMask() and XIMaskIsSet() for finding the correct
byte in case the event number is 8 or larger.  However, Qt does not set up
an array of bytes but rather a single 32-bit integer, and assumes that as long
as all events have numbers smaller than 32 it can just set the corresponding
bit in the 32-bit integer.  This happens to work on little endian since the
byte order on LE matches the hard-coded byte order of the input masks in
XInput2.  However, it does not work on big endian where the byte order differs.

In my proposed patch, I did not rewrite the code to use an array of bytes but
simply added a conversion to little endian of the 32-bit integer, which solves
the immediate issue.