Changeset View
Changeset View
Standalone View
Standalone View
activities.cpp
Show First 20 Lines • Show All 115 Lines • ▼ Show 20 Line(s) | 109 | for (auto it = transients_stacking_order.constBegin(); | |||
---|---|---|---|---|---|
116 | toggleClientOnActivity(c, activity, dont_activate); | 116 | toggleClientOnActivity(c, activity, dont_activate); | ||
117 | } | 117 | } | ||
118 | ws->updateClientArea(); | 118 | ws->updateClientArea(); | ||
119 | } | 119 | } | ||
120 | 120 | | |||
121 | bool Activities::start(const QString &id) | 121 | bool Activities::start(const QString &id) | ||
122 | { | 122 | { | ||
123 | Workspace *ws = Workspace::self(); | 123 | Workspace *ws = Workspace::self(); | ||
124 | if (ws->sessionSaving()) { | 124 | if (ws->sessionManager()->state() == SessionState::Saving) { | ||
125 | return false; //ksmserver doesn't queue requests (yet) | 125 | return false; //ksmserver doesn't queue requests (yet) | ||
126 | } | 126 | } | ||
127 | 127 | | |||
128 | if (!all().contains(id)) { | 128 | if (!all().contains(id)) { | ||
129 | return false; //bogus id | 129 | return false; //bogus id | ||
130 | } | 130 | } | ||
131 | 131 | | |||
132 | ws->loadSubSessionInfo(id); | 132 | ws->loadSubSessionInfo(id); | ||
133 | 133 | | |||
134 | QDBusInterface ksmserver("org.kde.ksmserver", "/KSMServer", "org.kde.KSMServerInterface"); | 134 | QDBusInterface ksmserver("org.kde.ksmserver", "/KSMServer", "org.kde.KSMServerInterface"); | ||
135 | if (ksmserver.isValid()) { | 135 | if (ksmserver.isValid()) { | ||
136 | ksmserver.asyncCall("restoreSubSession", id); | 136 | ksmserver.asyncCall("restoreSubSession", id); | ||
137 | } else { | 137 | } else { | ||
138 | qCDebug(KWIN_CORE) << "couldn't get ksmserver interface"; | 138 | qCDebug(KWIN_CORE) << "couldn't get ksmserver interface"; | ||
139 | return false; | 139 | return false; | ||
140 | } | 140 | } | ||
141 | return true; | 141 | return true; | ||
142 | } | 142 | } | ||
143 | 143 | | |||
144 | bool Activities::stop(const QString &id) | 144 | bool Activities::stop(const QString &id) | ||
145 | { | 145 | { | ||
146 | if (Workspace::self()->sessionSaving()) { | 146 | if (Workspace::self()->sessionManager()->state() == SessionState::Saving) { | ||
147 | return false; //ksmserver doesn't queue requests (yet) | 147 | return false; //ksmserver doesn't queue requests (yet) | ||
148 | //FIXME what about session *loading*? | 148 | //FIXME what about session *loading*? | ||
149 | } | 149 | } | ||
150 | 150 | | |||
151 | //ugly hack to avoid dbus deadlocks | 151 | //ugly hack to avoid dbus deadlocks | ||
152 | QMetaObject::invokeMethod(this, "reallyStop", Qt::QueuedConnection, Q_ARG(QString, id)); | 152 | QMetaObject::invokeMethod(this, "reallyStop", Qt::QueuedConnection, Q_ARG(QString, id)); | ||
153 | //then lie and assume it worked. | 153 | //then lie and assume it worked. | ||
154 | return true; | 154 | return true; | ||
155 | } | 155 | } | ||
156 | 156 | | |||
157 | void Activities::reallyStop(const QString &id) | 157 | void Activities::reallyStop(const QString &id) | ||
158 | { | 158 | { | ||
159 | Workspace *ws = Workspace::self(); | 159 | Workspace *ws = Workspace::self(); | ||
160 | if (ws->sessionSaving()) | 160 | if (ws->sessionManager()->state() == SessionState::Saving) | ||
161 | return; //ksmserver doesn't queue requests (yet) | 161 | return; //ksmserver doesn't queue requests (yet) | ||
162 | 162 | | |||
163 | qCDebug(KWIN_CORE) << id; | 163 | qCDebug(KWIN_CORE) << id; | ||
164 | 164 | | |||
165 | QSet<QByteArray> saveSessionIds; | 165 | QSet<QByteArray> saveSessionIds; | ||
166 | QSet<QByteArray> dontCloseSessionIds; | 166 | QSet<QByteArray> dontCloseSessionIds; | ||
167 | const ClientList &clients = ws->clientList(); | 167 | const ClientList &clients = ws->clientList(); | ||
168 | for (ClientList::const_iterator it = clients.constBegin(); it != clients.constEnd(); ++it) { | 168 | for (ClientList::const_iterator it = clients.constBegin(); it != clients.constEnd(); ++it) { | ||
▲ Show 20 Lines • Show All 50 Lines • Show Last 20 Lines |