diff options
author | Weblate <noreply@weblate.org> | 2016-10-03 12:12:45 +0000 |
---|---|---|
committer | Weblate <noreply@weblate.org> | 2016-10-03 12:12:45 +0000 |
commit | c8f94dc7519dab04b08f286fc760bb490dbb6f9b (patch) | |
tree | 9808abd67d538dd5ce66c517412603d6f9a0b1b5 /src-qt5/core/lumina-session/session.cpp | |
parent | Translated using Weblate (lumina_DESKTOP@es (generated)) (diff) | |
parent | Merge remote-tracking branch 'origin/master' (diff) | |
download | lumina-c8f94dc7519dab04b08f286fc760bb490dbb6f9b.tar.gz lumina-c8f94dc7519dab04b08f286fc760bb490dbb6f9b.tar.bz2 lumina-c8f94dc7519dab04b08f286fc760bb490dbb6f9b.zip |
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'src-qt5/core/lumina-session/session.cpp')
-rw-r--r-- | src-qt5/core/lumina-session/session.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src-qt5/core/lumina-session/session.cpp b/src-qt5/core/lumina-session/session.cpp index 5f9ca6c4..937f05d0 100644 --- a/src-qt5/core/lumina-session/session.cpp +++ b/src-qt5/core/lumina-session/session.cpp @@ -95,7 +95,7 @@ void LSession::start(){ //Compositing manager QSettings settings("lumina-desktop","sessionsettings"); if(settings.value("enableCompositing",true).toBool()){ - if(LUtils::isValidBinary("compton")){ + if(LUtils::isValidBinary("compton")){ QString set = QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/compton.conf"; if(!QFile::exists(set)){ if(QFile::exists(LOS::LuminaShare()+"/compton.conf")){ @@ -106,9 +106,21 @@ void LSession::start(){ qDebug() << "Using default compton settings"; startProcess("compositing","compton"); }else{ - startProcess("compositing","compton --config \""+set+"\"", QStringList() << set); + //Auto-detect if GLX is available on the system and turn it on/off as needed + bool startcompton = true; + if(LUtils::isValidBinary("glxinfo")){ + bool hasAccel =! LUtils::getCmdOutput("glxinfo -B").filter("direct rendering:").filter("Yes").isEmpty(); + qDebug() << "Detected GPU Acceleration:" << hasAccel; + QStringList info = LUtils::readFile(set); + for(int i=0; i<info.length(); i++){ + if(info[i].section("=",0,0).simplified()=="backend"){ info[i] = QString("backend = \"")+ (hasAccel ? "glx" : "xrender")+"\""; break; } //replace this line + } + LUtils::writeFile(set, info, true); + if( !hasAccel && settings.value("compositingWithGpuAccelOnly",true).toBool() ){ startcompton = false; } + } + if(startcompton){ startProcess("compositing","compton --config \""+set+"\"", QStringList() << set); } } - }else if(LUtils::isValidBinary("xcompmgr")){ startProcess("compositing","xcompmgr"); } + }else if(LUtils::isValidBinary("xcompmgr") && !settings.value("compositingWithGpuAccelOnly",true).toBool() ){ startProcess("compositing","xcompmgr"); } } //Desktop Next startProcess("runtime","lumina-desktop"); |