1

I build Qt-5.9.2 on Ubuntu 16.04.3 LTS with EGLFS QPA enabled.

I switch to terminal on Ctrl+Alt+F1 screen. Then I run my Qt application app (Qt Quick based, if matters):

# to debug input
export QT_LOGGING_RULES=qt.qpa.input=true
# to be able to close by Ctrl+C my application
export QT_QPA_ENABLE_TERMINAL_KEYBOARD=1
~/app -platform eglfs

So far so good: it starts normally and all looks fine. But touchscreen and mouse input are not handled by Qt. Debug output:

debug: libinput: opening input device '/dev/input/event1' failed (Operation not permitted).
debug: libinput: failed to create input device '/dev/input/event1'.
debug: libinput: opening input device '/dev/input/event2' failed (Operation not permitted).
debug: libinput: failed to create input device '/dev/input/event2'.
debug: libinput: opening input device '/dev/input/event0' failed (Operation not permitted).
debug: libinput: failed to create input device '/dev/input/event0'.
debug: libinput: opening input device '/dev/input/event8' failed (Operation not permitted).
debug: libinput: failed to create input device '/dev/input/event8'.
debug: libinput: opening input device '/dev/input/event3' failed (Operation not permitted).
debug: libinput: failed to create input device '/dev/input/event3'.
debug: libinput: opening input device '/dev/input/event4' failed (Operation not permitted).
debug: libinput: failed to create input device '/dev/input/event4'.
debug: libinput: opening input device '/dev/input/event7' failed (Operation not permitted).
debug: libinput: failed to create input device '/dev/input/event7'.
debug: libinput: opening input device '/dev/input/event5' failed (Operation not permitted).
debug: libinput: failed to create input device '/dev/input/event5'.
debug: libinput: opening input device '/dev/input/event6' failed (Operation not permitted).
debug: libinput: failed to create input device '/dev/input/event6'.
debug: libinput: opening input device '/dev/input/event9' failed (Operation not permitted).
debug: libinput: failed to create input device '/dev/input/event9'.
debug: libinput: opening input device '/dev/input/event10' failed (Operation not permitted).
debug: libinput: failed to create input device '/dev/input/event10'.
debug: libinput: opening input device '/dev/input/event11' failed (Operation not permitted).
debug: libinput: failed to create input device '/dev/input/event11'.
debug: libinput: opening input device '/dev/input/event12' failed (Operation not permitted).
debug: libinput: failed to create input device '/dev/input/event12'.
debug: libinput: opening input device '/dev/input/event13' failed (Operation not permitted).
debug: libinput: failed to create input device '/dev/input/event13'.
debug: Using xkbcommon for key mapping

Then I press Ctrl+C.

The next step is to check file permissions for device files:

$ ll /dev/input/event*
crw-rw---- 1 root input 13, 64 ноя  8 17:53 /dev/input/event0
crw-rw---- 1 root input 13, 65 ноя  8 17:53 /dev/input/event1
crw-rw---- 1 root input 13, 74 ноя  8 17:53 /dev/input/event10
crw-rw---- 1 root input 13, 75 ноя  8 17:53 /dev/input/event11
crw-rw---- 1 root input 13, 76 ноя  8 17:53 /dev/input/event12
crw-rw---- 1 root input 13, 77 ноя  8 17:53 /dev/input/event13
crw-rw---- 1 root input 13, 66 ноя  8 17:53 /dev/input/event2
crw-rw---- 1 root input 13, 67 ноя  8 17:53 /dev/input/event3
crw-rw---- 1 root input 13, 68 ноя  8 18:38 /dev/input/event4
crw-rw---- 1 root input 13, 69 ноя  8 17:53 /dev/input/event5
crw-rw---- 1 root input 13, 70 ноя  8 17:53 /dev/input/event6
crw-rw---- 1 root input 13, 71 ноя  8 18:38 /dev/input/event7
crw-rw---- 1 root input 13, 72 ноя  8 17:53 /dev/input/event8
crw-rw---- 1 root input 13, 73 ноя  8 17:53 /dev/input/event9

Okay. I decided to add current user to group input:

sudo usermod -a -G input $USER

Then I relogin on Ctrl+Alt+F1 screen. Now output of groups command contains input group.

I try again to run my application:

~/app -platform eglfs

Now it correctly react on mouse and touchscreen input events, but fonts are not rendered - there are even no correctly sized rectangles as placeholders instead of corresponding letters.

I remove the user from group input:

sudo deluser $USER input

Then (after relogin) I try to just change file permissions for input devices:

sudo chmod o=g /dev/input/event*

Effect is the same. Rollback:

sudo chmod o= /dev/input/event*

What is the cause of such a behaviour?

Why can't I use both libinput and fonts simultaneously?

The workaround is to run the application with root privileges, but it may lead to critical security vulnerability.

Are there specific settings for libinput to solve the problem?

Providing ad-hoc fonts also has no effect:

wget https://github.com/dejavu-fonts/dejavu-fonts/releases/download/version_2_37/dejavu-fonts-ttf-2.37.tar.bz2
sudo mkdir -p /usr/local/Qt-5.9.2/lib/fonts
sudo tar --extract --verbose --strip-components=2 -C /usr/local/Qt-5.9.2/lib/fonts --file dejavu-fonts-ttf-2.37.tar.bz2 dejavu-fonts-ttf-2.37/ttf/
export QT_QPA_FONTDIR=/usr/local/Qt-5.9.2/lib/fonts
Tomilov Anatoliy
  • 15,657
  • 10
  • 64
  • 169

1 Answers1

0

Submitted as a bug. Solved by adding to input group and by removing QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling); flag.

Tomilov Anatoliy
  • 15,657
  • 10
  • 64
  • 169