aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/RootDesktopObject.cpp
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2018-04-26 17:48:37 -0400
committerKen Moore <ken@ixsystems.com>2018-04-26 17:50:10 -0400
commitf228077850b16fdd92310782aafe3f7f2b437adb (patch)
treeaa622a0787d40597cf251f6af75381be13349405 /src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/RootDesktopObject.cpp
parentFix up the loading of *.desktop icons via LFileInfo (diff)
downloadlumina-f228077850b16fdd92310782aafe3f7f2b437adb.tar.gz
lumina-f228077850b16fdd92310782aafe3f7f2b437adb.tar.bz2
lumina-f228077850b16fdd92310782aafe3f7f2b437adb.zip
Commit a bunch more work on the Lumina 2 screen reservations.
Diffstat (limited to 'src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/RootDesktopObject.cpp')
-rw-r--r--src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/RootDesktopObject.cpp33
1 files changed, 32 insertions, 1 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 d9a81f54..79737ddc 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
@@ -18,6 +18,10 @@ RootDesktopObject::RootDesktopObject(QObject *parent) : QObject(parent){
connect(this, SIGNAL(changePanels(QStringList)), this, SLOT(setPanels(QStringList)) );
currentTimeTimer = new QTimer(this);
connect(currentTimeTimer, SIGNAL(timeout()), this, SLOT(updateCurrentTime()) );
+ availgeomTimer = new QTimer(this);
+ availgeomTimer->setInterval(100);
+ availgeomTimer->setSingleShot(true);
+ connect(availgeomTimer, SIGNAL(timeout()), this, SLOT(submitSessionGeom()) );
}
RootDesktopObject::~RootDesktopObject(){
@@ -170,6 +174,16 @@ void RootDesktopObject::setPanels(QStringList ids){
change = true; //list changed
}
} //end loop over screens+session
+ //Now calculate the available session geometry
+ QRegion sess(geom);
+ for(int i=0; i<panel_objects.length(); i++){
+ sess = sess.subtracted( QRegion(panel_objects[i].geometry()) );
+ }
+ if(sess != session_avail_geom){
+ session_avail_geom = sess;
+ emit sessionGeomAvailableChanged(); }
+ }
+
if(change){ emit panelsChanged(); }
}
@@ -242,6 +256,10 @@ QList<NativeWindowObject*> RootDesktopObject::windowObjects(){
return window_objects;
}
+QList<ScreenObject*> RootDesktopObject::screenObjects(){
+ return s_objects;
+}
+
// === PUBLIC SLOTS ===
void RootDesktopObject::updateScreens(){
QList<QScreen*> scrns = QApplication::screens();
@@ -251,7 +269,11 @@ void RootDesktopObject::updateScreens(){
for(int j=0; j<s_objects.length() && !found; j++){
if(s_objects[j]->name()==scrns[i]->name()){ found = true; tmp << s_objects.takeAt(j); }
}
- if(!found){ tmp << new ScreenObject(scrns[i], this); }
+ if(!found){
+ //Create new screen object
+ tmp << new ScreenObject(scrns[i], this);
+ connect(tmp.last(), SIGNAL(availableGeomChanged()), this, SLOT(availableScreenGeomChanged()) );
+ }
}
//Delete any leftover objects
for(int i=0; i<s_objects.length(); i++){ s_objects[i]->deleteLater(); }
@@ -291,3 +313,12 @@ void RootDesktopObject::updateCurrentTime(){
emit currentTimeChanged();
}
}
+
+void RootDesktopObject::availableScreenGeomChanged(){
+ if(availgeomTimer->isActive()){ availgeomTimer->stop(); }
+ availgeomTimer->start();
+}
+
+void RootDesktopObject::submitSessionGeom(){
+ //TODO - read off the available geom from each ScreenObject and register that with NativeWindowSystem
+}
bgstack15