aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp')
-rw-r--r--src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/RootDesktopObject.cpp10
-rw-r--r--src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/RootDesktopObject.h2
-rw-r--r--src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/ScreenObject.cpp5
3 files changed, 12 insertions, 5 deletions
diff --git a/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/RootDesktopObject.cpp b/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/RootDesktopObject.cpp
index 79737ddc..9d48c28d 100644
--- a/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/RootDesktopObject.cpp
+++ b/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/RootDesktopObject.cpp
@@ -175,13 +175,13 @@ void RootDesktopObject::setPanels(QStringList ids){
}
} //end loop over screens+session
//Now calculate the available session geometry
- QRegion sess(geom);
+ QRegion sess(total);
for(int i=0; i<panel_objects.length(); i++){
- sess = sess.subtracted( QRegion(panel_objects[i].geometry()) );
+ sess = sess.subtracted( QRegion(panel_objects[i]->geometry()) );
}
if(sess != session_avail_geom){
session_avail_geom = sess;
- emit sessionGeomAvailableChanged(); }
+ emit sessionGeomAvailableChanged();
}
if(change){ emit panelsChanged(); }
@@ -260,6 +260,10 @@ QList<ScreenObject*> RootDesktopObject::screenObjects(){
return s_objects;
}
+QRegion* RootDesktopObject::availableGeometry(){
+ return &session_avail_geom;
+}
+
// === PUBLIC SLOTS ===
void RootDesktopObject::updateScreens(){
QList<QScreen*> scrns = QApplication::screens();
diff --git a/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/RootDesktopObject.h b/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/RootDesktopObject.h
index 4a722ec0..f88a547c 100644
--- a/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/RootDesktopObject.h
+++ b/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/RootDesktopObject.h
@@ -46,6 +46,7 @@ public:
Q_INVOKABLE QString currentTime();
Q_INVOKABLE QDateTime currentDateTime();
+
//QML Globals Access
Q_INVOKABLE OSInterface* os_interface();
@@ -58,6 +59,7 @@ public:
//C++ Access Functions (simplifications for the QML ones)
QList<NativeWindowObject*> windowObjects();
QList<ScreenObject*> screenObjects();
+ QRegion* availableGeometry();
private:
QList<ScreenObject*> s_objects;
diff --git a/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/ScreenObject.cpp b/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/ScreenObject.cpp
index d6e0abb6..f36db2be 100644
--- a/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/ScreenObject.cpp
+++ b/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/ScreenObject.cpp
@@ -7,11 +7,12 @@
#include "ScreenObject.h"
#include <QQmlEngine>
#include <QDebug>
+#include "RootDesktopObject.h"
ScreenObject::ScreenObject(QScreen *scrn, QObject *parent) : QObject(parent){
bg_screen = scrn;
connect(this, SIGNAL(changePanels(QStringList)), this, SLOT(setPanels(QStringList)) );
- connect(RootWindowObject::instance(), SIGNAL(sessionGeomAvailableChanged()), this, SLOT(updateAvailableGeometry()) );
+ connect(RootDesktopObject::instance(), SIGNAL(sessionGeomAvailableChanged()), this, SLOT(updateAvailableGeometry()) );
}
void ScreenObject::RegisterType(){
@@ -52,7 +53,7 @@ void ScreenObject::setPanels(QStringList ids){
QRegion *sess = RootDesktopObject::instance()->availableGeometry();
QRect avail = sess->intersected(bg_screen->geometry()).boundingRect();
- if(session_available_geometry.isNull()){ avail = bg_screen->geometry(); }
+ if(avail.isNull()){ avail = bg_screen->geometry(); }
//First update/remove any current panel objects
bool change = false;
for(int i=0; i<panel_objects.length(); i++){
bgstack15