Changeset View
Changeset View
Standalone View
Standalone View
sm.cpp
Show First 20 Lines • Show All 196 Lines • ▼ Show 20 Line(s) | 173 | { | |||
---|---|---|---|---|---|
197 | cg.writeEntry(QLatin1String("skipTaskbar") + n, c->originalSkipTaskbar()); | 197 | cg.writeEntry(QLatin1String("skipTaskbar") + n, c->originalSkipTaskbar()); | ||
198 | cg.writeEntry(QLatin1String("skipPager") + n, c->skipPager()); | 198 | cg.writeEntry(QLatin1String("skipPager") + n, c->skipPager()); | ||
199 | cg.writeEntry(QLatin1String("skipSwitcher") + n, c->skipSwitcher()); | 199 | cg.writeEntry(QLatin1String("skipSwitcher") + n, c->skipSwitcher()); | ||
200 | // not really just set by user, but name kept for back. comp. reasons | 200 | // not really just set by user, but name kept for back. comp. reasons | ||
201 | cg.writeEntry(QLatin1String("userNoBorder") + n, c->userNoBorder()); | 201 | cg.writeEntry(QLatin1String("userNoBorder") + n, c->userNoBorder()); | ||
202 | cg.writeEntry(QLatin1String("windowType") + n, windowTypeToTxt(c->windowType())); | 202 | cg.writeEntry(QLatin1String("windowType") + n, windowTypeToTxt(c->windowType())); | ||
203 | cg.writeEntry(QLatin1String("shortcut") + n, c->shortcut().toString()); | 203 | cg.writeEntry(QLatin1String("shortcut") + n, c->shortcut().toString()); | ||
204 | cg.writeEntry(QLatin1String("stackingOrder") + n, unconstrained_stacking_order.indexOf(c)); | 204 | cg.writeEntry(QLatin1String("stackingOrder") + n, unconstrained_stacking_order.indexOf(c)); | ||
205 | // KConfig doesn't support long so we need to live with less precision on 64-bit systems | | |||
206 | cg.writeEntry(QLatin1String("tabGroup") + n, static_cast<int>(reinterpret_cast<long>(c->tabGroup()))); | | |||
207 | cg.writeEntry(QLatin1String("activities") + n, c->activities()); | 205 | cg.writeEntry(QLatin1String("activities") + n, c->activities()); | ||
208 | } | 206 | } | ||
209 | 207 | | |||
210 | void Workspace::storeSubSession(const QString &name, QSet<QByteArray> sessionIds) | 208 | void Workspace::storeSubSession(const QString &name, QSet<QByteArray> sessionIds) | ||
211 | { | 209 | { | ||
212 | //TODO clear it first | 210 | //TODO clear it first | ||
213 | KConfigGroup cg(KSharedConfig::openConfig(), QLatin1String("SubSession: ") + name); | 211 | KConfigGroup cg(KSharedConfig::openConfig(), QLatin1String("SubSession: ") + name); | ||
214 | int count = 0; | 212 | int count = 0; | ||
▲ Show 20 Lines • Show All 67 Lines • ▼ Show 20 Line(s) | 259 | for (int i = 1; i <= count; i++) { | |||
282 | info->skipTaskbar = cg.readEntry(QLatin1String("skipTaskbar") + n, false); | 280 | info->skipTaskbar = cg.readEntry(QLatin1String("skipTaskbar") + n, false); | ||
283 | info->skipPager = cg.readEntry(QLatin1String("skipPager") + n, false); | 281 | info->skipPager = cg.readEntry(QLatin1String("skipPager") + n, false); | ||
284 | info->skipSwitcher = cg.readEntry(QLatin1String("skipSwitcher") + n, false); | 282 | info->skipSwitcher = cg.readEntry(QLatin1String("skipSwitcher") + n, false); | ||
285 | info->noBorder = cg.readEntry(QLatin1String("userNoBorder") + n, false); | 283 | info->noBorder = cg.readEntry(QLatin1String("userNoBorder") + n, false); | ||
286 | info->windowType = txtToWindowType(cg.readEntry(QLatin1String("windowType") + n, QString()).toLatin1().constData()); | 284 | info->windowType = txtToWindowType(cg.readEntry(QLatin1String("windowType") + n, QString()).toLatin1().constData()); | ||
287 | info->shortcut = cg.readEntry(QLatin1String("shortcut") + n, QString()); | 285 | info->shortcut = cg.readEntry(QLatin1String("shortcut") + n, QString()); | ||
288 | info->active = (active_client == i); | 286 | info->active = (active_client == i); | ||
289 | info->stackingOrder = cg.readEntry(QLatin1String("stackingOrder") + n, -1); | 287 | info->stackingOrder = cg.readEntry(QLatin1String("stackingOrder") + n, -1); | ||
290 | info->tabGroup = cg.readEntry(QLatin1String("tabGroup") + n, 0); | | |||
291 | info->tabGroupClient = NULL; | | |||
292 | info->activities = cg.readEntry(QLatin1String("activities") + n, QStringList()); | 288 | info->activities = cg.readEntry(QLatin1String("activities") + n, QStringList()); | ||
293 | } | 289 | } | ||
294 | } | 290 | } | ||
295 | 291 | | |||
296 | void Workspace::loadSubSessionInfo(const QString &name) | 292 | void Workspace::loadSubSessionInfo(const QString &name) | ||
297 | { | 293 | { | ||
298 | KConfigGroup cg(KSharedConfig::openConfig(), QLatin1String("SubSession: ") + name); | 294 | KConfigGroup cg(KSharedConfig::openConfig(), QLatin1String("SubSession: ") + name); | ||
299 | addSessionInfo(cg); | 295 | addSessionInfo(cg); | ||
▲ Show 20 Lines • Show All 58 Lines • ▼ Show 20 Line(s) | 352 | if (info->resourceName == resourceName | |||
358 | && sessionInfoWindowTypeMatch(c, info)) { | 354 | && sessionInfoWindowTypeMatch(c, info)) { | ||
359 | if (wmCommand.isEmpty() || info->wmCommand == wmCommand) { | 355 | if (wmCommand.isEmpty() || info->wmCommand == wmCommand) { | ||
360 | realInfo = info; | 356 | realInfo = info; | ||
361 | session.removeAll(info); | 357 | session.removeAll(info); | ||
362 | } | 358 | } | ||
363 | } | 359 | } | ||
364 | } | 360 | } | ||
365 | } | 361 | } | ||
366 | | ||||
367 | // Set tabGroupClient for other clients in the same group | | |||
368 | if (realInfo && realInfo->tabGroup) { | | |||
369 | foreach (SessionInfo * info, session) { | | |||
370 | if (!info->tabGroupClient && info->tabGroup == realInfo->tabGroup) | | |||
371 | info->tabGroupClient = c; | | |||
372 | } | | |||
373 | } | | |||
374 | | ||||
375 | return realInfo; | 362 | return realInfo; | ||
376 | } | 363 | } | ||
377 | 364 | | |||
378 | // KWin's focus stealing prevention causes problems with user interaction | 365 | // KWin's focus stealing prevention causes problems with user interaction | ||
379 | // during session save, as it prevents possible dialogs from getting focus. | 366 | // during session save, as it prevents possible dialogs from getting focus. | ||
380 | // Therefore it's temporarily disabled during session saving. Start of | 367 | // Therefore it's temporarily disabled during session saving. Start of | ||
381 | // session saving can be detected in SessionManager::saveState() above, | 368 | // session saving can be detected in SessionManager::saveState() above, | ||
382 | // but Qt doesn't have API for saying when session saved finished (either | 369 | // but Qt doesn't have API for saying when session saved finished (either | ||
▲ Show 20 Lines • Show All 151 Lines • Show Last 20 Lines |