Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Screensaver
Forum Updated to NodeBB v4.3 + New Features

Screensaver

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 3 Posters 833 Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • mrdebugM Offline
    mrdebugM Offline
    mrdebug
    wrote on last edited by
    #1

    Hi, can someone suggest me a cross platform way (Windows, Linux, Mac) to postpone or momentary disable till the app is running the screensaver?

    Need programmers to hire?
    www.labcsp.com
    www.denisgottardello.it
    GMT+1
    Skype: mrdebug

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Do you mean suspend your application when the screen saver starts ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • mrdebugM Offline
        mrdebugM Offline
        mrdebug
        wrote on last edited by
        #3

        no no, I need to suspend the screensaver when my gui application is running.

        Need programmers to hire?
        www.labcsp.com
        www.denisgottardello.it
        GMT+1
        Skype: mrdebug

        1 Reply Last reply
        0
        • mrdebugM Offline
          mrdebugM Offline
          mrdebug
          wrote on last edited by mrdebug
          #4

          Windows

          SetThreadExecutionState(ES_DISPLAY_REQUIRED);
          SetThreadExecutionState(ES_CONTINUOUS);
          

          Linux

          Display *display= XOpenDisplay(nullptr);
          if (display) {
              XResetScreenSaver(display);
              XCloseDisplay(display);
          }
          

          Mac

          IOPMAssertionID AssertionID;
          IOPMAssertionCreateWithName(kIOPMAssertionTypeNoDisplaySleep, kIOPMAssertionLevelOn, CFSTR("PianoJokeTouch"), &AssertionID);
          

          Need programmers to hire?
          www.labcsp.com
          www.denisgottardello.it
          GMT+1
          Skype: mrdebug

          V 1 Reply Last reply
          4
          • mrdebugM mrdebug

            Windows

            SetThreadExecutionState(ES_DISPLAY_REQUIRED);
            SetThreadExecutionState(ES_CONTINUOUS);
            

            Linux

            Display *display= XOpenDisplay(nullptr);
            if (display) {
                XResetScreenSaver(display);
                XCloseDisplay(display);
            }
            

            Mac

            IOPMAssertionID AssertionID;
            IOPMAssertionCreateWithName(kIOPMAssertionTypeNoDisplaySleep, kIOPMAssertionLevelOn, CFSTR("PianoJokeTouch"), &AssertionID);
            
            V Offline
            V Offline
            Violet Giraffe
            wrote on last edited by
            #5

            @mrdebug said in Screensaver:

            XOpenDisplay

            I assume this only works for X11 and not Wayland?

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved