9 #ifdef X11_Xscreensaver_FOUND
10 # include <X11/extensions/scrnsaver.h>
13 #include <X11/extensions/dpms.h>
18 Display *display =
nullptr;
19 bool extensionSupported =
false;
20 bool dpmsSupported =
false;
21 QTimer *timer =
nullptr;
25 if (display !=
nullptr) {
28 display = QX11Info::display();
29 if (display ==
nullptr) {
32 #ifdef X11_Xscreensaver_FOUND
34 extensionSupported = (XScreenSaverQueryExtension(display, &dummy, &dummy) == True);
37 dpmsSupported = (DPMSCapable(display) == True);
50 #ifdef X11_Xscreensaver_FOUND
51 if (extensionSupported) {
52 XScreenSaverSuspend(display, allow ? False : True);
57 if (timer !=
nullptr) {
61 if (timer ==
nullptr) {
65 timer->setSingleShot(
false);
74 QProcess::startDetached(
"xscreensaver-command", QStringList() <<
"-deactivate");
78 if (DPMSInfo(display, &power_level, &state) && state) {
79 DPMSForceLevel(display, DPMSModeOn);
void allowSaverAndStandby(bool allow)
Whether we want to allow the screen saver to activate or the screen to enter standby.
void forceUnlockAndScreenOn()
Disable the screen saver (only if password locking is disabled!), power screen on if it's in standby...