aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/libLumina
diff options
context:
space:
mode:
Diffstat (limited to 'src-qt5/core/libLumina')
-rw-r--r--src-qt5/core/libLumina/LuminaX11.cpp18
-rw-r--r--src-qt5/core/libLumina/LuminaX11.h5
-rw-r--r--src-qt5/core/libLumina/LuminaX11.pri2
3 files changed, 20 insertions, 5 deletions
diff --git a/src-qt5/core/libLumina/LuminaX11.cpp b/src-qt5/core/libLumina/LuminaX11.cpp
index 1df5a9f0..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; }
@@ -462,12 +474,12 @@ int LXCB::WindowIsFullscreen(WId win){
int i = 0;
for(it = screens.constBegin(); it != screens.constEnd(); ++it, ++i) {
QRect sgeom = (*it)->availableGeometry();
- qDebug() << " -- Check Window Geom:" << sgeom << geom << this->WindowClass(win);
+ //qDebug() << " -- Check Window Geom:" << sgeom << geom << this->WindowClass(win);
if( sgeom.contains(geom.center()) ){
//Allow a 1 pixel variation in "full-screen" detection
- qDebug() << " -- Found Screen:" << i;
+ //qDebug() << " -- Found Screen:" << i;
if( geom.width() >= (sgeom.width()-1) && geom.height()>=(sgeom.height()-1) ){
- qDebug() << " -- Is Fullscreen!";
+ //qDebug() << " -- Is Fullscreen!";
//fullS = true;
fscreen = i;
}
diff --git a/src-qt5/core/libLumina/LuminaX11.h b/src-qt5/core/libLumina/LuminaX11.h
index 453d3443..a2c0c58a 100644
--- a/src-qt5/core/libLumina/LuminaX11.h
+++ b/src-qt5/core/libLumina/LuminaX11.h
@@ -90,7 +90,7 @@ public:
//XCB Library replacement for LX11 (Qt5 uses XCB instead of XLib)
class LXCB{
-
+
public:
enum WINDOWVISIBILITY {IGNORE, INVISIBLE, VISIBLE, ACTIVE, ATTENTION}; //note that this in order of priority
enum ICCCM_STATE {WITHDRAWN, NORMAL, ICONIC};
@@ -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
bgstack15