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