navit-project.org
http://forum.navit-project.org/

Preventing screensaver
http://forum.navit-project.org/viewtopic.php?f=12&t=621
Page 1 of 1

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

Hi,

When running navit, it would be beneficial to the users to have the screensaver/sleep suspended. There was a request http://trac.navit-project.org/ticket/194 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: http://stackoverflow.com/questions/6292 ... is-running
Previously I implemented it in my Qt5 code as follows:
Code:
    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(){
        SetThreadExecutionState(ES_CONTINUOUS);
        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
http://www.phpbb.com/