Ввод и шрифты являются взаимоисключающими на EGLFS QPA

я строю Qt-5.9.2 на Ubuntu 16.04.3 LTS с EGLFS QPA включен.

Я переключаюсь на терминал Ctrl + Alt + F1, экран. Тогда я бегу Qt приложение app (Qt Quick на основании, если имеет значение):

# 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

Пока все хорошо: все начинается нормально и все выглядит хорошо. Но сенсорный экран и ввод мышью не обрабатываются Qt. Отладочный вывод:

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

Тогда я нажимаю Ctrl + C,.

Следующим шагом является проверка прав доступа к файлам для устройств:

$ 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

Хорошо. Я решил добавить текущего пользователя в группу input:

sudo usermod -a -G input $USER

Тогда я перехожу на Ctrl + Alt + F1, экран. Теперь вывод groups команда содержит input группа.

Я пытаюсь снова запустить мое приложение:

~/app -platform eglfs

Теперь он корректно реагирует на события ввода с помощью мыши и сенсорного экрана, но шрифты не отображаются — даже нет прямоугольников правильного размера в качестве заполнителей вместо соответствующих букв.

Удаляю пользователя из группы input:

sudo deluser $USER input

Затем (после relogin) я пытаюсь просто изменить права доступа к файлам для устройств ввода:

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

Эффект тот же. Откат:

sudo chmod o= /dev/input/event*

В чем причина такого поведения?

Почему я не могу использовать оба libinput а шрифты одновременно?

Обходной путь — запустить приложение с правами root, но это может привести к критической уязвимости безопасности.

Есть ли конкретные настройки для libinput решить проблему?

Предоставление специальных шрифтов также не имеет никакого эффекта:

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

1

Решение

Представлено как ошибка. Решено добавлением к input группа и удалив QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling); флаг.

0

Другие решения

Других решений пока нет …

По вопросам рекламы ammmcru@yandex.ru
Adblock
detector