aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core
diff options
context:
space:
mode:
Diffstat (limited to 'src-qt5/core')
-rw-r--r--src-qt5/core/libLumina/LuminaXDG.cpp3
-rw-r--r--src-qt5/core/libLumina/LuminaXDG.h1
-rw-r--r--src-qt5/core/lumina-desktop/LDesktop.cpp11
-rw-r--r--src-qt5/core/lumina-desktop/LSession.h1
-rw-r--r--src-qt5/core/lumina-desktop/LXcbEventFilter.cpp4
-rw-r--r--src-qt5/core/lumina-session/session.cpp6
6 files changed, 19 insertions, 7 deletions
diff --git a/src-qt5/core/libLumina/LuminaXDG.cpp b/src-qt5/core/libLumina/LuminaXDG.cpp
index 790b386e..dbb70e43 100644
--- a/src-qt5/core/libLumina/LuminaXDG.cpp
+++ b/src-qt5/core/libLumina/LuminaXDG.cpp
@@ -531,6 +531,9 @@ void LFileInfo::loadExtraInfo(){
mime = LXDG::findAppMimeForFile(this->fileName());
}
}
+LFileInfo::LFileInfo(){
+ desk = 0;
+}
LFileInfo::LFileInfo(QString filepath){ //overloaded contructor
this->setFile(filepath);
loadExtraInfo();
diff --git a/src-qt5/core/libLumina/LuminaXDG.h b/src-qt5/core/libLumina/LuminaXDG.h
index dd9d1c67..acb688ff 100644
--- a/src-qt5/core/libLumina/LuminaXDG.h
+++ b/src-qt5/core/libLumina/LuminaXDG.h
@@ -125,6 +125,7 @@ private:
public:
//Couple overloaded contructors
+ LFileInfo();
LFileInfo(QString filepath);
LFileInfo(QFileInfo info);
~LFileInfo(){
diff --git a/src-qt5/core/lumina-desktop/LDesktop.cpp b/src-qt5/core/lumina-desktop/LDesktop.cpp
index f1b73bc0..980b3e5e 100644
--- a/src-qt5/core/lumina-desktop/LDesktop.cpp
+++ b/src-qt5/core/lumina-desktop/LDesktop.cpp
@@ -209,6 +209,7 @@ void LDesktop::InitDesktop(){
connect(QApplication::instance(), SIGNAL(DesktopConfigChanged()), this, SLOT(SettingsChanged()) );
connect(QApplication::instance(), SIGNAL(DesktopFilesChanged()), this, SLOT(UpdateDesktop()) );
connect(QApplication::instance(), SIGNAL(LocaleChanged()), this, SLOT(LocaleChanged()) );
+ connect(QApplication::instance(), SIGNAL(WorkspaceChanged()), this, SLOT(UpdateBackground()) );
if(DEBUG){ qDebug() << "Create bgWindow"; }
bgWindow = new LDesktopBackground();
@@ -478,7 +479,9 @@ void LDesktop::UpdateBackground(){
bgupdating = true;
if(DEBUG){ qDebug() << " - Update Desktop Background for screen:" << desktopnumber; }
//Get the list of background(s) to show
- QStringList bgL = settings->value(DPREFIX+"background/filelist", QStringList()).toStringList();
+ QStringList bgL = settings->value(DPREFIX+"background/filelist-workspace-"+QString::number( LSession::handle()->XCB->CurrentWorkspace()), QStringList()).toStringList();
+ if(bgL.isEmpty()){ bgL = settings->value(DPREFIX+"background/filelist", QStringList()).toStringList(); }
+
//qDebug() << " - List:" << bgL << CBG;
//Remove any invalid files
for(int i=0; i<bgL.length(); i++){
@@ -495,11 +498,9 @@ void LDesktop::UpdateBackground(){
}
oldBGL = bgL; //save this for later
//Determine which background to use next
- int index;
- if(CBG.isEmpty()){ index = ( qrand() % bgL.length() ); } //random first wallpaper
- else{
+ int index ( qrand() % bgL.length() );
+ if(index== bgL.indexOf(CBG)){ //if the current wallpaper was selected by the randomization again
//Go to the next in the list
- index = bgL.indexOf(CBG);
if(index < 0 || index >= bgL.length()-1){ index = 0; } //if invalid or last item in the list - go to first
else{ index++; } //go to next
}
diff --git a/src-qt5/core/lumina-desktop/LSession.h b/src-qt5/core/lumina-desktop/LSession.h
index c19b3f09..d19cf70c 100644
--- a/src-qt5/core/lumina-desktop/LSession.h
+++ b/src-qt5/core/lumina-desktop/LSession.h
@@ -185,6 +185,7 @@ signals:
void DesktopConfigChanged();
void SessionConfigChanged();
void DesktopFilesChanged();
+ void WorkspaceChanged();
};
diff --git a/src-qt5/core/lumina-desktop/LXcbEventFilter.cpp b/src-qt5/core/lumina-desktop/LXcbEventFilter.cpp
index c8321c49..3c92c050 100644
--- a/src-qt5/core/lumina-desktop/LXcbEventFilter.cpp
+++ b/src-qt5/core/lumina-desktop/LXcbEventFilter.cpp
@@ -46,6 +46,10 @@ bool XCBEventFilter::nativeEventFilter(const QByteArray &eventType, void *messag
&& ( ( ((xcb_property_notify_event_t*)ev)->atom == session->XCB->EWMH._NET_DESKTOP_GEOMETRY) \
|| (((xcb_property_notify_event_t*)ev)->atom == session->XCB->EWMH._NET_WORKAREA) )){
session->RootSizeChange();
+ }else if( ((xcb_property_notify_event_t*)ev)->window == QX11Info::appRootWindow() \
+ && ( ( ((xcb_property_notify_event_t*)ev)->atom == session->XCB->EWMH._NET_CURRENT_DESKTOP) )){
+ qDebug() << "Got Workspace Change";
+ session->emit WorkspaceChanged();
}else if( SysNotifyAtoms.contains( ((xcb_property_notify_event_t*)ev)->atom ) ){
//Update the status/list of all running windows
session->WindowPropertyEvent();
diff --git a/src-qt5/core/lumina-session/session.cpp b/src-qt5/core/lumina-session/session.cpp
index 0e88a227..937f05d0 100644
--- a/src-qt5/core/lumina-session/session.cpp
+++ b/src-qt5/core/lumina-session/session.cpp
@@ -107,6 +107,7 @@ void LSession::start(){
startProcess("compositing","compton");
}else{
//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;
@@ -115,10 +116,11 @@ void LSession::start(){
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; }
}
- startProcess("compositing","compton --config \""+set+"\"", QStringList() << set);
+ 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");
bgstack15