Solved Screensaver
-
Hi, can someone suggest me a cross platform way (Windows, Linux, Mac) to postpone or momentary disable till the app is running the screensaver?
-
Hi,
Do you mean suspend your application when the screen saver starts ?
-
no no, I need to suspend the screensaver when my gui application is running.
-
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);
-