diff options
author | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2015-02-24 13:51:21 +0100 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2015-03-06 07:13:21 +0000 |
commit | f6e6ef46b382e1a7f827afc5f70ce6e5deaa7e86 (patch) | |
tree | d466e53e50b99b32064319907c2f2edad74939bc /src/platformsupport/eglconvenience | |
parent | 374c60e046405601ff5089c1da6f63a4bc7ea6dc (diff) |
Fix up signal handling in QFbVtHandler
Start using signalfd where we can. Drop the crash (SIGSEGV, SIGBUS) handling completely.
The crash handling that was in place previously was not async-safe. It also prevented getting
a core dump. So just remove it. There is no safe solution for a single application process since
restoring the keyboard, video modes, etc. all need unsafe calls in the signal handler almost for sure.
We can however improve the handling of non-crash scenarios greatly:
Introduce support for SIGINT, allowing nicely and cleanly restoring the video
mode with the KMS backend when pressing Ctrl+C while QT_QPA_ENABLE_TERMINAL_KEYBOARD
is set.
Same goes for keyboard suspend (SIGTSTP, Ctrl+Z). When QT_QPA_ENABLE_TERMINAL_KEYBOARD is set,
platform plugins now have the possibility to act upon Ctrl+Z. As an example eglfs' KMS backend
is enhanced to handle this by restoring the video mode before suspending the process, and
reinitializing when brought into foreground again (SIGCONT).
SIGTERM is also handled. This is extremely handy when starting an application locally on the embedded
device and then kill-ing it via a remote ssh session. Keyboard and video mode is now cleanly restored.
Finally, when disabling the keyboard, try setting also KDSKBMUTE.
Change-Id: I2b3608dc23c798e2b39f74cb27f12dcb0e958435
Reviewed-by: Louai Al-Khanji <louai.al-khanji@theqtcompany.com>
Diffstat (limited to 'src/platformsupport/eglconvenience')
-rw-r--r-- | src/platformsupport/eglconvenience/qeglplatformintegration_p.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/platformsupport/eglconvenience/qeglplatformintegration_p.h b/src/platformsupport/eglconvenience/qeglplatformintegration_p.h index 3b6c862333..42fbf8c8a1 100644 --- a/src/platformsupport/eglconvenience/qeglplatformintegration_p.h +++ b/src/platformsupport/eglconvenience/qeglplatformintegration_p.h @@ -90,6 +90,8 @@ public: QFunctionPointer platformFunction(const QByteArray &function) const Q_DECL_OVERRIDE; + QFbVtHandler *vtHandler() { return m_vtHandler.data(); } + protected: virtual QEGLPlatformWindow *createWindow(QWindow *window) const = 0; virtual QEGLPlatformContext *createContext(const QSurfaceFormat &format, |