Changeset View
Changeset View
Standalone View
Standalone View
layers.cpp
Show First 20 Lines • Show All 503 Lines • ▼ Show 20 Line(s) | |||||
504 | /** | 504 | /** | ||
505 | * Returns a stacking order based upon \a list that fulfills certain contained. | 505 | * Returns a stacking order based upon \a list that fulfills certain contained. | ||
506 | */ | 506 | */ | ||
507 | QList<Toplevel *> Workspace::constrainedStackingOrder() | 507 | QList<Toplevel *> Workspace::constrainedStackingOrder() | ||
508 | { | 508 | { | ||
509 | QList<Toplevel *> layer[ NumLayers ]; | 509 | QList<Toplevel *> layer[ NumLayers ]; | ||
510 | 510 | | |||
511 | // build the order from layers | 511 | // build the order from layers | ||
512 | QVector< QMap<Group*, Layer> > minimum_layer(screens()->count()); | 512 | QVector< QMultiMap<Group*, Layer> > minimum_layer(screens()->count()); | ||
513 | for (auto it = unconstrained_stacking_order.constBegin(), | 513 | for (auto it = unconstrained_stacking_order.constBegin(), | ||
514 | end = unconstrained_stacking_order.constEnd(); it != end; ++it) { | 514 | end = unconstrained_stacking_order.constEnd(); it != end; ++it) { | ||
515 | Layer l = (*it)->layer(); | 515 | Layer l = (*it)->layer(); | ||
516 | 516 | | |||
517 | const int screen = (*it)->screen(); | 517 | const int screen = (*it)->screen(); | ||
518 | X11Client *c = qobject_cast<X11Client *>(*it); | 518 | X11Client *c = qobject_cast<X11Client *>(*it); | ||
519 | QMap< Group*, Layer >::iterator mLayer = minimum_layer[screen].find(c ? c->group() : nullptr); | 519 | QMap< Group*, Layer >::iterator mLayer = minimum_layer[screen].find(c ? c->group() : nullptr); | ||
520 | if (mLayer != minimum_layer[screen].end()) { | 520 | if (mLayer != minimum_layer[screen].end()) { | ||
521 | // If a window is raised above some other window in the same window group | 521 | // If a window is raised above some other window in the same window group | ||
522 | // which is in the ActiveLayer (i.e. it's fulscreened), make sure it stays | 522 | // which is in the ActiveLayer (i.e. it's fulscreened), make sure it stays | ||
523 | // above that window (see #95731). | 523 | // above that window (see #95731). | ||
524 | if (*mLayer == ActiveLayer && (l > BelowLayer)) | 524 | if (*mLayer == ActiveLayer && (l > BelowLayer)) | ||
525 | l = ActiveLayer; | 525 | l = ActiveLayer; | ||
526 | *mLayer = l; | 526 | *mLayer = l; | ||
527 | } else if (c) { | 527 | } else if (c) { | ||
528 | minimum_layer[screen].insertMulti(c->group(), l); | 528 | minimum_layer[screen].insert(c->group(), l); | ||
529 | } | 529 | } | ||
530 | layer[ l ].append(*it); | 530 | layer[ l ].append(*it); | ||
531 | } | 531 | } | ||
532 | QList<Toplevel *> stacking; | 532 | QList<Toplevel *> stacking; | ||
533 | for (int lay = FirstLayer; lay < NumLayers; ++lay) { | 533 | for (int lay = FirstLayer; lay < NumLayers; ++lay) { | ||
534 | stacking += layer[lay]; | 534 | stacking += layer[lay]; | ||
535 | } | 535 | } | ||
536 | // now keep transients above their mainwindows | 536 | // now keep transients above their mainwindows | ||
▲ Show 20 Lines • Show All 328 Lines • Show Last 20 Lines |