aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-desktop
diff options
context:
space:
mode:
Diffstat (limited to 'src-qt5/core/lumina-desktop')
-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
3 files changed, 11 insertions, 5 deletions
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();
bgstack15