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
parent
249c5f0689
commit
5f49467c52
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue