diff options
author | Weblate <noreply@weblate.org> | 2016-09-27 16:14:37 +0000 |
---|---|---|
committer | Weblate <noreply@weblate.org> | 2016-09-27 16:14:37 +0000 |
commit | c80736d2c8b43be05b67416438e99017a5ced3dc (patch) | |
tree | fb1974512932ede4c9a2e138cf603a50d6d112b9 /src-qt5/core/lumina-session/session.cpp | |
parent | Translated using Weblate (l_TERMINAL@it (generated)) (diff) | |
parent | Merge branch 'master' of github.com:trueos/lumina (diff) | |
download | lumina-c80736d2c8b43be05b67416438e99017a5ced3dc.tar.gz lumina-c80736d2c8b43be05b67416438e99017a5ced3dc.tar.bz2 lumina-c80736d2c8b43be05b67416438e99017a5ced3dc.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 | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src-qt5/core/lumina-session/session.cpp b/src-qt5/core/lumina-session/session.cpp index 5f9ca6c4..0e88a227 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,6 +106,16 @@ void LSession::start(){ qDebug() << "Using default compton settings"; startProcess("compositing","compton"); }else{ + //Auto-detect if GLX is available on the system and turn it on/off as needed + 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); + } startProcess("compositing","compton --config \""+set+"\"", QStringList() << set); } }else if(LUtils::isValidBinary("xcompmgr")){ startProcess("compositing","xcompmgr"); } |