diff options
author | Kris Moore <kris@pcbsd.org> | 2016-02-06 08:29:31 -0500 |
---|---|---|
committer | Kris Moore <kris@pcbsd.org> | 2016-02-06 08:29:31 -0500 |
commit | 561c11ce6e9acd194c095a77e8c07accedf93512 (patch) | |
tree | 4af64d004802865d4cae8dcf644387e58ffebe4c /lumina-desktop | |
parent | Change the icon used for the "show desktop" plugin to match the icon the plug... (diff) | |
download | lumina-561c11ce6e9acd194c095a77e8c07accedf93512.tar.gz lumina-561c11ce6e9acd194c095a77e8c07accedf93512.tar.bz2 lumina-561c11ce6e9acd194c095a77e8c07accedf93512.zip |
Fix a bug with Lumina-DE segfaulting during wakeup on some specific
cards / monitors. Caused problems on my 4K displayport here, and
possibly other video-card / monitor combos where the screen is marked
as removed when the monitor goes to sleep.
Diffstat (limited to 'lumina-desktop')
-rw-r--r-- | lumina-desktop/LSession.cpp | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/lumina-desktop/LSession.cpp b/lumina-desktop/LSession.cpp index b33f19ee..8215cb5a 100644 --- a/lumina-desktop/LSession.cpp +++ b/lumina-desktop/LSession.cpp @@ -481,12 +481,15 @@ void LSession::refreshWindowManager(){ void LSession::updateDesktops(){ qDebug() << " - Update Desktops"; QDesktopWidget *DW = this->desktop(); - qDebug() << " -- Number:" << DW->screenCount(); - for(int i=0; i<DW->screenCount(); i++){ qDebug() << " -- Screen["+QString::number(i)+"]:" << DW->screenGeometry(i); } + int sC = DW->screenCount(); + qDebug() << " -- Number:" << sC; + if(sC<1){ return; } //stop here - no screens available temporarily (displayport/4K issue) + + for(int i=0; i<sC; i++){ qDebug() << " -- Screen["+QString::number(i)+"]:" << DW->screenGeometry(i); } bool firstrun = (DESKTOPS.length()==0); - bool numchange = DESKTOPS.length()!=DW->screenCount(); + bool numchange = DESKTOPS.length()!=sC; //qDebug() << " -- Desktop Flags:" << firstrun << numchange << DW->isVirtualDesktop(); - for(int i=0; i<DW->screenCount(); i++){ + for(int i=0; i<sC; i++){ bool found = false; for(int j=0; j<DESKTOPS.length() && !found; j++){ if(DESKTOPS[j]->Screen()==i ){ found = true; } @@ -499,10 +502,17 @@ void LSession::updateDesktops(){ } if(!firstrun){//Done right here on first run //Now go through and make sure to delete any desktops for detached screens - if(DW->screenCount()<1){ return; } //stop here - no screens available temporarily (displayport/4K issue) for(int i=0; i<DESKTOPS.length(); i++){ - if(DESKTOPS[i]->Screen() >= DW->screenCount()){ + + // Check for 0x0 screen geom + QRect geom = DW->screenGeometry(i); + if ( geom.isNull() ) + continue; + if ( geom.x() == 0 || geom.y() == 0 ) + continue; + + if(DESKTOPS[i]->Screen() >= sC){ qDebug() << " - Close desktop on screen:" << DESKTOPS[i]->Screen(); DESKTOPS[i]->prepareToClose(); delete DESKTOPS.takeAt(i); |