aboutsummaryrefslogtreecommitdiff
path: root/lumina-desktop/LSession.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lumina-desktop/LSession.cpp')
-rw-r--r--lumina-desktop/LSession.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/lumina-desktop/LSession.cpp b/lumina-desktop/LSession.cpp
index aa3fa923..b7ccbbe5 100644
--- a/lumina-desktop/LSession.cpp
+++ b/lumina-desktop/LSession.cpp
@@ -677,7 +677,11 @@ WId LSession::activeWindow(){
//qDebug() << "Check Active Window:" << active << lastActiveWin;
if(RunningApps.contains(active)){ lastActiveWin = active; }
else if(RunningApps.contains(lastActiveWin) && XCB->WindowState(lastActiveWin) >= LXCB::VISIBLE){} //no change needed
- else{
+ else if(RunningApps.contains(lastActiveWin) && RunningApps.length()>1){
+ int start = RunningApps.indexOf(lastActiveWin);
+ if(start<1){ lastActiveWin = RunningApps.length()-1; } //wrap around to the last item
+ else{ lastActiveWin = RunningApps[start-1]; }
+ }else{
//Need to change the last active window - find the first one which is visible
lastActiveWin = 0; //fallback value - nothing active
for(int i=0; i<RunningApps.length(); i++){
bgstack15