mmatyas / pegasus-frontend

A cross platform, customizable graphical frontend for launching emulators and managing your game collection.
http://pegasus-frontend.org
Other
1.17k stars 104 forks source link

Error out when starting the program in EGLFS mode, if the user can't access the input files #1124

Open Lokito23 opened 1 week ago

Lokito23 commented 1 week ago

The problem

If you start Pegasus using EGLFS on Linux, but don't have access to the input files (/dev/input/), all input stops working.

The program still runs, but you lost the control over the whole computer, with the only way to stop it being to shutdown.

A solution

Detect if the user is on Linux, and if he is, detect if he has access to /dev/input/ directory, if not, crash the program and throw an error that recommends the user to either modify the permissions on the input files, or to add themselves to the input group.

mmatyas commented 1 week ago

I believe this might be a Qt issue; Pegasus itself doesn't do anything platform-specific as accessing /dev/input/, it receives input through Qt and/or SDL2. It seems on EGLFS, Qt processes input depending on the input plugin you use/built Qt with, see https://doc.qt.io/qt-5/inputs-linux-device.html. If you can reproduce this with other Qt apps (eg. Qt's own demos), you could report it to the Qt devs here: https://bugreports.qt.io/browse/QTBUG

Lokito23 commented 1 week ago

Understood, I'll test soon

Lokito23 commented 1 week ago

It happens in Dolphin (the file explorer), and Kate too, so it seems to be QT related, however I am not sure about it being a bug.

From what I have seen, they want the user to have access to the input files, which, unless you are inside the input group, or have changed the permissions of them, you do not have it. My guess is that it's security related.

As for asking QT to add a crash handler for this, I doubt it could work. You can still use EGLFS without input, for example on a billboard, so I think they will just say it's intended, or that it should be done application side.

Lokito23 commented 1 week ago

But if needed, I can still file the bug, just that the odds are that it's intended for security reasons.

EDIT: Decided to open an issue anyways.