QNX: Add option to disable screen power save from an envvar

Qt itself has no API for disabling screen power save, although this
might make an interesting addition at some point.

Instead we make the QNX QPA plugin determine if power save should be
disabled from the QQNX_DISABLE_POWER_SAVE environment variable. This
would typically be set in the application's bar descriptor file.

Change-Id: Ie195ecd0496efd533ad9a32b65883283f471c534
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
bb10
Sean Harmer 2013-06-11 11:29:22 +01:00 committed by The Qt Project
parent 249c5f0689
commit 5f49467c52
1 changed files with 10 additions and 0 deletions

View File

@ -162,6 +162,16 @@ QQnxRootWindow::QQnxRootWindow(const QQnxScreen *screen)
if (result != 0)
qFatal("QQnxRootWindow: failed to set window source position, errno=%d", errno);
// Optionally disable the screen power save
bool ok = false;
const int disablePowerSave = qgetenv("QQNX_DISABLE_POWER_SAVE").toInt(&ok);
if (ok && disablePowerSave) {
const int mode = SCREEN_IDLE_MODE_KEEP_AWAKE;
result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_IDLE_MODE, &mode);
if (result != 0)
qWarning("QQnxRootWindow: failed to disable power saving mode");
}
createWindowGroup();
// Don't post yet. This will be lazily done from QQnxScreen upon first posting of