aboutsummaryrefslogtreecommitdiff
path: root/src-qt5
diff options
context:
space:
mode:
Diffstat (limited to 'src-qt5')
-rw-r--r--src-qt5/core/libLumina/LuminaX11.cpp12
-rw-r--r--src-qt5/core/libLumina/LuminaX11.h3
-rw-r--r--src-qt5/core/libLumina/LuminaX11.pri2
-rw-r--r--src-qt5/core/lumina-desktop/src-screensaver/LScreenSaver.cpp3
4 files changed, 19 insertions, 1 deletions
diff --git a/src-qt5/core/libLumina/LuminaX11.cpp b/src-qt5/core/libLumina/LuminaX11.cpp
index 3262e16d..6a71f629 100644
--- a/src-qt5/core/libLumina/LuminaX11.cpp
+++ b/src-qt5/core/libLumina/LuminaX11.cpp
@@ -27,6 +27,7 @@
#include <xcb/xcb_aux.h>
#include <xcb/composite.h>
#include <xcb/damage.h>
+#include <xcb/dpms.h>
//XLib includes
#include <X11/extensions/Xdamage.h>
@@ -184,6 +185,17 @@ void LXCB::SetCurrentWorkspace(int number){
xcb_ewmh_request_change_showing_desktop(&EWMH, QX11Info::appScreen(), number);
}
+//Display Power Management System (DPMS)
+// ===== enableDPMS() =====
+void LXCB::enableDPMS(){
+ xcb_dpms_enable(QX11Info::connection());
+}
+
+// ===== disableDPMS() =====
+void LXCB::disableDPMS(){
+ xcb_dpms_disable(QX11Info::connection());
+}
+
// === WindowClass() ===
QString LXCB::WindowClass(WId win){
if(DEBUG){ qDebug() << "XCB: WindowClass()" << win; }
diff --git a/src-qt5/core/libLumina/LuminaX11.h b/src-qt5/core/libLumina/LuminaX11.h
index 02897aee..a2c0c58a 100644
--- a/src-qt5/core/libLumina/LuminaX11.h
+++ b/src-qt5/core/libLumina/LuminaX11.h
@@ -123,6 +123,9 @@ public:
bool CheckDisableXinerama(); //returns true if Xinerama was initially set but now disabled
void RegisterVirtualRoots(QList<WId> roots);
void SetCurrentWorkspace(int);
+ //Display Power Management System (DPMS)
+ void enableDPMS();
+ void disableDPMS();
//Window Information
QString WindowClass(WId);
diff --git a/src-qt5/core/libLumina/LuminaX11.pri b/src-qt5/core/libLumina/LuminaX11.pri
index 0e472dd4..e22b83ad 100644
--- a/src-qt5/core/libLumina/LuminaX11.pri
+++ b/src-qt5/core/libLumina/LuminaX11.pri
@@ -1,7 +1,7 @@
QT *= x11extras
-LIBS *= -lc -lxcb -lxcb-ewmh -lxcb-icccm -lxcb-image -lxcb-composite -lxcb-damage -lxcb-util -lXdamage
+LIBS *= -lc -lxcb -lxcb-ewmh -lxcb-icccm -lxcb-image -lxcb-composite -lxcb-damage -lxcb-util -lxcb-dpms -lXdamage
#LUtils Files
SOURCES *= $${PWD}/LuminaX11.cpp
diff --git a/src-qt5/core/lumina-desktop/src-screensaver/LScreenSaver.cpp b/src-qt5/core/lumina-desktop/src-screensaver/LScreenSaver.cpp
index 850f14b4..6ccd8420 100644
--- a/src-qt5/core/lumina-desktop/src-screensaver/LScreenSaver.cpp
+++ b/src-qt5/core/lumina-desktop/src-screensaver/LScreenSaver.cpp
@@ -66,6 +66,7 @@ void LScreenSaver::UpdateTimers(){
// ===========
void LScreenSaver::start(){
reloadSettings(); //setup all the initial time frames
+ LSession::handle()->XCB->disableDPMS(); //disable this initially - this only gets turned on when the screensaver activates
starttimer->start();
checkTimer->start();
}
@@ -128,6 +129,7 @@ void LScreenSaver::ShowScreenSaver(){
//QApplication::setOverrideCursor(QCursor::BlankCursor);
SSRunning = true;
updating = true;
+ LSession::handle()->XCB->enableDPMS();
//Now remove any current Base widgets (prevent any lingering painting between sessions)
for(int i=0; i<BASES.length(); i++){
if(DEBUG){ qDebug() << " - Removing SS Base"; }
@@ -183,6 +185,7 @@ void LScreenSaver::HideScreenSaver(){
//QApplication::restoreOverrideCursor();
if(DEBUG){ qDebug() << "Hiding Screen Saver:" << QDateTime::currentDateTime().toString(); }
SSRunning = false;
+ LSession::handle()->XCB->disableDPMS();
//if(cBright>0){ LOS::setScreenBrightness(cBright); } //return to current brightness
this->releaseKeyboard();
if(!SSLocked){
bgstack15