diff --git a/client.h b/client.h --- a/client.h +++ b/client.h @@ -132,8 +132,6 @@ void releaseWindow(bool on_shutdown = false); void destroyClient(); - virtual int desktop() const; - virtual QStringList activities() const; void setOnActivity(const QString &activity, bool enable); void setOnAllActivities(bool set) override; diff --git a/client.cpp b/client.cpp --- a/client.cpp +++ b/client.cpp @@ -1320,20 +1320,6 @@ } /** - * Returns the virtual desktop within the workspace() the client window - * is located in, 0 if it isn't located on any special desktop (not mapped yet), - * or NET::OnAllDesktops. Do not use desktop() directly, use - * isOnDesktop() instead. - */ -int Client::desktop() const -{ - if (needsSessionInteract) { - return NET::OnAllDesktops; - } - return AbstractClient::desktop(); -} - -/** * Returns the list of activities the client window is on. * if it's on all activities, the list will be empty. * Don't use this, use isOnActivity() and friends (from class Toplevel) diff --git a/manage.cpp b/manage.cpp --- a/manage.cpp +++ b/manage.cpp @@ -596,35 +596,10 @@ else allow = workspace()->allowClientActivation(this, userTime(), false); - if (!(isMapped || session)) { - if (workspace()->sessionSaving()) { - /* - * If we get a new window during session saving, we assume it's some 'save file?' dialog - * which the user really needs to see (to know why logout's stalled). - * - * Given the current session management protocol, I can't see a nicer way of doing this. - * Someday I'd like to see a protocol that tells the windowmanager who's doing SessionInteract. - */ - needsSessionInteract = true; - //show the parent too - auto mainclients = mainClients(); - for (auto it = mainclients.constBegin(); - it != mainclients.constEnd(); ++it) { - if (Client *mc = dynamic_cast((*it))) { - mc->setSessionInteract(true); - } - (*it)->unminimize(); - } - } else if (allow) { - // also force if activation is allowed - if (!isOnCurrentDesktop() && options->focusPolicyIsReasonable()) { - VirtualDesktopManager::self()->setCurrent(desktop()); - } - /*if (!isOnCurrentActivity()) { - workspace()->setCurrentActivity( activities().first() ); - } FIXME no such method*/ - } - } + // If session saving, force showing new windows (i.e. "save file?" dialogs etc.) + // also force if activation is allowed + if( !isOnCurrentDesktop() && !isMapped && !session && ( allow || workspace()->sessionSaving() )) + VirtualDesktopManager::self()->setCurrent( desktop()); if (isOnCurrentDesktop() && !isMapped && !allow && (!session || session->stackingOrder < 0)) workspace()->restackClientUnderActive(this); diff --git a/toplevel.h b/toplevel.h --- a/toplevel.h +++ b/toplevel.h @@ -272,6 +272,12 @@ virtual bool isLockScreen() const; virtual bool isInputMethod() const; + /** + * Returns the virtual desktop within the workspace() the client window + * is located in, 0 if it isn't located on any special desktop (not mapped yet), + * or NET::OnAllDesktops. Do not use desktop() directly, use + * isOnDesktop() instead. + */ virtual int desktop() const = 0; virtual QStringList activities() const = 0; bool isOnDesktop(int d) const;