aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-desktop/LSession.cpp
diff options
context:
space:
mode:
authorKen Moore <ken@pcbsd.org>2016-04-28 09:49:13 -0400
committerKen Moore <ken@pcbsd.org>2016-04-28 09:49:13 -0400
commit1e9b663c06a451b215f6fe47e920ff130f4d963a (patch)
tree70d29783552f0e42d3ced7fcd95f47556b0095b6 /src-qt5/core/lumina-desktop/LSession.cpp
parentAdd "bool" to the C++ syntax highlighting. (diff)
downloadlumina-1e9b663c06a451b215f6fe47e920ff130f4d963a.tar.gz
lumina-1e9b663c06a451b215f6fe47e920ff130f4d963a.tar.bz2
lumina-1e9b663c06a451b215f6fe47e920ff130f4d963a.zip
Have lumina listen to the X root window property changes directly - and update the screen numbers/geometries 50ms after the WM changes the _NET_DESKTOP_GEOMETRY or _NET_WORKAREA properties on it. This bypasses a bug in the QDesktopWidget class where it might not send out the changed() signals when something really did change (noticed this in virtualbox instances in particular).
Diffstat (limited to 'src-qt5/core/lumina-desktop/LSession.cpp')
-rw-r--r--src-qt5/core/lumina-desktop/LSession.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/src-qt5/core/lumina-desktop/LSession.cpp b/src-qt5/core/lumina-desktop/LSession.cpp
index b1a4b55e..2ab01d79 100644
--- a/src-qt5/core/lumina-desktop/LSession.cpp
+++ b/src-qt5/core/lumina-desktop/LSession.cpp
@@ -48,8 +48,7 @@ LSession::LSession(int &argc, char ** argv) : LSingleApplication(argc, argv, "lu
TrayStopping = false;
screenTimer = new QTimer(this);
screenTimer->setSingleShot(true);
- screenTimer->setInterval(1000); //2 seconds - This needs to be long(ish) to prevent being called while
- // X is still setting up any screens
+ screenTimer->setInterval(50);
connect(screenTimer, SIGNAL(timeout()), this, SLOT(updateDesktops()) );
for(int i=1; i<argc; i++){
if( QString::fromLocal8Bit(argv[i]) == "--noclean" ){ cleansession = false; break; }
@@ -161,8 +160,8 @@ void LSession::setupSession(){
watcher->addPath( QDir::homePath()+"/Desktop" );
//connect internal signals/slots
- connect(this->desktop(), SIGNAL(screenCountChanged(int)), this, SLOT(screensChanged()) );
- connect(this->desktop(), SIGNAL(resized(int)), this, SLOT(screenResized(int)) );
+ //connect(this->desktop(), SIGNAL(screenCountChanged(int)), this, SLOT(screensChanged()) );
+ //connect(this->desktop(), SIGNAL(resized(int)), this, SLOT(screenResized(int)) );
connect(watcher, SIGNAL(directoryChanged(QString)), this, SLOT(watcherChange(QString)) );
connect(watcher, SIGNAL(fileChanged(QString)), this, SLOT(watcherChange(QString)) );
connect(this, SIGNAL(aboutToQuit()), this, SLOT(SessionEnding()) );
@@ -723,6 +722,13 @@ void LSession::playAudioFile(QString filepath){
// =======================
// XCB EVENT FILTER FUNCTIONS
// =======================
+void LSession::RootSizeChange(){
+ qDebug() << "Got Root Size Change";
+ if(DESKTOPS.isEmpty()){ return; } //Initial setup not run yet
+ screenTimer->start();
+ //QTimer::singleShot(0,this, SLOT(screensChanged()) );
+}
+
void LSession::WindowPropertyEvent(){
if(DEBUG){ qDebug() << "Window Property Event"; }
QList<WId> newapps = XCB->WindowList();
bgstack15