diff --git a/client.h b/client.h --- a/client.h +++ b/client.h @@ -314,8 +314,8 @@ void readColorScheme(Xcb::StringProperty &property); void updateColorScheme(); - //sets whether the client should be treated as a SessionInteract window - void setSessionInteract(bool needed); + //sets whether the client should be faked as being on all activities (and be shown during session save) + void setSessionActivityOverride(bool needed); virtual bool isClient() const; template @@ -590,7 +590,7 @@ void checkActivities(); bool activitiesDefined; //whether the x property was actually set - bool needsSessionInteract; + bool sessionActivityOverride; bool needsXWindowMove; Xcb::Window m_decoInputExtent; diff --git a/client.cpp b/client.cpp --- a/client.cpp +++ b/client.cpp @@ -120,7 +120,7 @@ , shade_geometry_change(false) , sm_stacking_order(-1) , activitiesDefined(false) - , needsSessionInteract(false) + , sessionActivityOverride(false) , needsXWindowMove(false) , m_decoInputExtent() , m_focusOutTimer(nullptr) @@ -1326,7 +1326,7 @@ */ QStringList Client::activities() const { - if (needsSessionInteract) { + if (sessionActivityOverride) { return QStringList(); } return activityList; @@ -1959,9 +1959,10 @@ #endif } -void Client::setSessionInteract(bool needed) +void Client::setSessionActivityOverride(bool needed) { - needsSessionInteract = needed; + sessionActivityOverride = needed; + updateActivities(false); } QRect Client::decorationRect() const diff --git a/manage.cpp b/manage.cpp --- a/manage.cpp +++ b/manage.cpp @@ -601,6 +601,16 @@ if( !isOnCurrentDesktop() && !isMapped && !session && ( allow || workspace()->sessionSaving() )) VirtualDesktopManager::self()->setCurrent( desktop()); + // If the window is on an inactive activity during session saving, temporarily force it to show. + if( !isMapped && !session && workspace()->sessionSaving() && !isOnCurrentActivity()) { + setSessionActivityOverride( true ); + foreach( AbstractClient* c, mainClients()) { + if (Client *mc = dynamic_cast(c)) { + mc->setSessionActivityOverride(true); + } + } + } + if (isOnCurrentDesktop() && !isMapped && !allow && (!session || session->stackingOrder < 0)) workspace()->restackClientUnderActive(this); diff --git a/sm.cpp b/sm.cpp --- a/sm.cpp +++ b/sm.cpp @@ -140,7 +140,7 @@ void Workspace::storeClient(KConfigGroup &cg, int num, Client *c) { - c->setSessionInteract(false); //make sure we get the real values + c->setSessionActivityOverride(false); //make sure we get the real values QString n = QString::number(num); cg.writeEntry(QLatin1String("sessionId") + n, c->sessionId().constData()); cg.writeEntry(QLatin1String("windowRole") + n, c->windowRole().constData()); @@ -519,9 +519,8 @@ void Workspace::sessionSaveDone() { session_saving = false; - //remove sessionInteract flag from all clients foreach (Client * c, clients) { - c->setSessionInteract(false); + c->setSessionActivityOverride(false); } }