From dbea548a43682f6f19e73b24b5d8f0ba7393f9ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Wed, 7 Mar 2012 15:19:06 +0100 Subject: [PATCH] select minimum layer per screen BUG: 261799 REVIEW: 104186 --- layers.cpp | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/layers.cpp b/layers.cpp index 31d1c49d11..13fa1b2987 100644 --- a/layers.cpp +++ b/layers.cpp @@ -515,20 +515,23 @@ ClientList Workspace::constrainedStackingOrder() kDebug(1212) << (void*)(*it) << *it << ":" << (*it)->layer(); #endif // build the order from layers - QHash< Group*, Layer > minimum_layer; - for (ClientList::ConstIterator it = unconstrained_stacking_order.constBegin(); - it != unconstrained_stacking_order.constEnd(); - ++it) { + QVector< QMap > minimum_layer(numScreens()); + for (ClientList::ConstIterator it = unconstrained_stacking_order.constBegin(), + end = unconstrained_stacking_order.constEnd(); it != end; ++it) { Layer l = (*it)->layer(); - // If a window is raised above some other window in the same window group - // which is in the ActiveLayer (i.e. it's fulscreened), make sure it stays - // above that window (see #95731). - if (minimum_layer.contains((*it)->group()) - && minimum_layer[(*it)->group()] == ActiveLayer - && (l == NormalLayer || l == AboveLayer)) { - l = minimum_layer[(*it)->group()]; + + const int screen = (*it)->screen(); + QMap< Group*, Layer >::iterator mLayer = minimum_layer[screen].find((*it)->group()); + if (mLayer != minimum_layer[screen].end()) { + // If a window is raised above some other window in the same window group + // which is in the ActiveLayer (i.e. it's fulscreened), make sure it stays + // above that window (see #95731). + if (*mLayer == ActiveLayer && (l == NormalLayer || l == AboveLayer)) + l = ActiveLayer; + *mLayer = l; + } else { + minimum_layer[screen].insertMulti((*it)->group(), l); } - minimum_layer[(*it)->group()] = l; layer[ l ].append(*it); } ClientList stacking;