Skip to content

Commit

Permalink
QNX: Add option to disable screen power save from an envvar
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Rafael Roquetto <[email protected]>
  • Loading branch information
seanharmer authored and The Qt Project committed Jun 19, 2013
1 parent 249c5f0 commit 5f49467
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/plugins/platforms/qnx/qqnxrootwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5f49467

Please sign in to comment.