I run Gnome as my desktop environment, and the mouse works fine. However, when I try to use a QT application, mouse clicks don't work correctly. For example, if I click and release inside a text editor, it begins highlighting the text as if I'm still holding down the mouse button. It's as if it doesn't register the mouse up event.

Any ideas why this might be happening, or how to troubleshoot it?

  • I'm seeing this problem as well and haven't found any useful information or work arounds. – dvj Jun 1 '18 at 18:10
  • 1
    This may be a cause, although upstream has closed the bug under the hope that Qt 5.12+ will fix this: bugreports.qt.io/browse/QTBUG-54085 – NeilenMarais Apr 10 '19 at 22:13

I find that simply tapping my touch screen after this happens clears the issue. This is with Ubuntu 18.04 with an Acer Spin 1 . This usually happens when I'm using FreeCAD.

| improve this answer | |
  • Same problem here, and tapping the touchscreen solved it. Go figure... I was having problems with Arduino IDE, Audacity and Robo3t. Thanks, that bug was really annoying. – pagliuca Jun 28 '19 at 12:18

Finally, a general solution!

The problem is caused by Qt's support for touch screens. What I've done is use xinput to disable the touch screen:

$ xinput --list
⎡ Virtual core pointer                          id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ DLL06E5:01 06CB:7A13 Touchpad             id=14   [slave  pointer  (2)]
⎜   ↳ ELAN Touchscreen                          id=13   [slave  pointer  (2)]
⎣ Virtual core keyboard                         id=3    [master keyboard (2)]
[... bunch of keyboard stuff]

The "ELAN Touchscreen" input is the one we care about. It's id is 13. So:

$ xinput --disable 13

With the touch screen input turned off, the problem no longer happens. I don't have to restart the Qt applications that are already running. Touch can be reenabled with:

$ xinput --enable 13

This AskUbuntu question shows other ways to turn off touch. Unfortunately, I do not know of a way to turn off touch only for a specific application, or only for Qt applications.

The reason the problem did not happen with Xephyr (as described below) is because Xephyr starts without support for touch events.

(I'm keeping this information around as it may help people diagnose similar issues in the future, or people looking for a finer-grained solution.)

I ran into this problem while trying to run Qt 5 applications under a Gnome desktop. I found that if I run the Qt application in a Xephyr session, the issue goes away:

$ Xephyr :1 -screen 1240x800 &
$ DISPLAY=:1 path/to/executable

Xephyr is an Xserver that can act as a client of another Xserver. (I've also tried Xnest, and it works too.) By running the software in a different Xserver, it is essentially isolated from the destkop environment running on the default Xserver.

For some use-case scenarios, this may be a usable workaround. Unfortunately, the isolation means that cut-and-paste between the app running in Xephyr and the other apps would require adding some substantial glue.

I've tried lxqt-config to see if I could change some Qt settings to fix the problem but did not find a setting that fixed the issue.

I also tried starting the app with -style=gtk but that only changes the visual style without changing the behavior.

| improve this answer | |
  • Using an Acer Spin with touhscreen I find that it works in Xephyr (I'm seeing the issue with FreeCAD), but disabling my touchscreen with xinput did not help. – NeilenMarais Apr 10 '19 at 19:59
  • Me neither @NeilenMarais with a Lenovo Yoga 700 – selan Jun 24 '19 at 16:04
  • Oh, It works now for me: first i disabled touch screen, then i kill touchegg program that acts as some kind of driver for my touchscreen. Then I restart the touchscreen and the problem disappeared. Maybe only killing touchegg is enough. – selan Jun 24 '19 at 16:14

I have the same issue with an ASUS Chromebook running XFCE in a chroot (Crouton).

I did manage to unset the mousedown by repeatedly poking the screen over Dolphin until (I guess?) it handled a "mouse up" event.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.