Preventing screensaver
Page 1 of 1

Author:  DrmCa [ 27 Dec 2016, 14:47 ]
Post subject:  Preventing screensaver


When running navit, it would be beneficial to the users to have the screensaver/sleep suspended. There was a request which recommended running a script or 3d party program, but that is not really helpful. The method to suspend screensaver is described here for example: ... is-running
Previously I implemented it in my Qt5 code as follows:
    static void noSleep(){
        if (SetThreadExecutionState(ES_CONTINUOUS | ES_SYSTEM_REQUIRED | ES_AWAYMODE_REQUIRED) == 0){
           SetThreadExecutionState(ES_CONTINUOUS | ES_SYSTEM_REQUIRED);
        qDebug() << "Disabled sleep mode";
    static void canSleep(){
        qDebug() << "Enabled sleep mode";

Can you add this to navit under conditional directive to disable sleep mode at least in Windows when navit is full screen?

Happy new year everyone!

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group