Qt-Wayland: Touch input behaving wonky.



  • Hi all!

    I have cross-compiled Qt 5.12 with Wayland and tslib.

    After placing everything on my embedded board, I calibrated my touchscreen using ts_calibrate. My touchscreen is MCT101HDMI-A-RTP and it is recognized as /dev/input/event2
    I can confirm that when running ts_test that the cursor follows my finger nicely as I move it around the touchscreen.

    Once I knew that I calibrated my touchscreen for tslib, I decided to try using it for Qt.
    I have the following environment variables set when running the example:
    export QT_LOGGING_RULES="qt.qpa.input=true"
    export QT_QPA_EGLFS_TSLIB=1
    export TSLIB_TSDEVICE=/dev/input/event2
    export TSLIB_CONFFILE=/etc/ts.conf
    export TSLIB_CALIBFILE=/etc/pointercal
    export TSLIB_PLUGINDIR=/usr/lib/ts

    I then launch the an example Qt Wayland compositor like so:

    /usr/local/Qt-5.12.0/examples/wayland/minimal-qml/minimal-qml -plugin tslib

    I then begin to trace my finger across the screen. Weirdly enough, the cursor seems to jump between where my finger is and another random location. I can confirm this behavior exists when running other examples of wayland. Even when I launch applications using the -wayland platform flag, the touchscreen is still wonky on them as well.

    I also noticed that if I pressed quickly, the cursor starts where my finger was, jumps to a random location, and then returns back to where my finger was when I lift my finger off. If I just hold my finger in place for several seconds, I can watch as the cursor jumps between my finger and this random location. Definitely weird.

    Does anyone have any suggestions?



  • I figured out my issue.

    I set the following environment variable:

    QT_QPA_EGLFS_DISABLE_INPUT=1

    Of course, the cursor dissapears, but when pressing around my Gui running on the Compositor I'm not noticing any buttons being pressed except when I press in them, so that's definitely preferred to a wonky cursor!