summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2019-10-07 13:08:33 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2019-10-08 14:32:12 +0000
commit45b76fc4eac1acd38a899753b115a89038a0de71 (patch)
treeccd00e213e7f02b9992ad47b715bde8ff67bb394
parent3dd8f6dc34a1357018484158a5e91c3afc71ae77 (diff)
eglfs/linuxfb: Add an env.var. to disable screen/cursor control
By default we disable screen blank and hide the cursor. This is something inherited from Qt 4. Then reset to some default values when exiting. This is not ideal when the system is configured with kernel parameters like consoleblank=0 or vt.global_cursor_default=0. So have a way to skip all tty voodoo. On systems where relevant, one can now launch with QT_QPA_PRESERVE_CONSOLE_STATE=1 set. [ChangeLog][Platform Specific Changes][Linux] Added an environment variable QT_QPA_PRESERVE_CONSOLE_STATE that can be used to prevent Qt from altering the tty screen and cursor settings when running with platforms like linuxfb and eglfs. Task-number: QTBUG-61916 Change-Id: I0e84e53f2d5fca992a7d26d0280ba35e30523379 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
-rw-r--r--src/platformsupport/fbconvenience/qfbvthandler.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/platformsupport/fbconvenience/qfbvthandler.cpp b/src/platformsupport/fbconvenience/qfbvthandler.cpp
index 7bb9e28ac2..8aab0bada4 100644
--- a/src/platformsupport/fbconvenience/qfbvthandler.cpp
+++ b/src/platformsupport/fbconvenience/qfbvthandler.cpp
@@ -70,6 +70,10 @@ QT_BEGIN_NAMESPACE
#ifdef VTH_ENABLED
static void setTTYCursor(bool enable)
{
+ static bool ignore = qEnvironmentVariableIntValue("QT_QPA_PRESERVE_CONSOLE_STATE");
+ if (ignore)
+ return;
+
const char * const devs[] = { "/dev/tty0", "/dev/tty", "/dev/console", 0 };
int fd = -1;
for (const char * const *dev = devs; *dev; ++dev) {