diff --git a/layers.cpp b/layers.cpp index 1273ec073c..ce579e751e 100644 --- a/layers.cpp +++ b/layers.cpp @@ -155,7 +155,12 @@ void Workspace::propagateClients(bool propagate_new_clients) // it ensures that no client will be ever shown above override-redirect // windows (e.g. popups). newWindowStack << (Window*)supportWindow->winId(); - newWindowStack << m_screenEdge.windows(); + QVectorIterator it(m_screenEdge.windows()); + while (it.hasNext()) { + if ((Window)it.next() != None) { + newWindowStack << (Window*)⁢ + } + } for (int i = stacking_order.size() - 1; i >= 0; i--) { if (stacking_order.at(i)->hiddenPreview()) { continue; diff --git a/screenedge.cpp b/screenedge.cpp index fe51bae221..e612461559 100644 --- a/screenedge.cpp +++ b/screenedge.cpp @@ -48,10 +48,10 @@ namespace KWin { ScreenEdge::ScreenEdge() : QObject(NULL) + , m_screenEdgeWindows(ELECTRIC_COUNT, None) { for (int i = 0; i < ELECTRIC_COUNT; ++i) { m_screenEdgeReserved[i] = 0; - m_screenEdgeWindows[i] = None; } } @@ -377,15 +377,9 @@ void ScreenEdge::raiseWindows() delete [] windows; } -const QVector< Window* >& ScreenEdge::windows() +const QVector< Window >& ScreenEdge::windows() { - QVector< Window* >* screenEdgeWindows = new QVector< Window* >(); - for (int i = 0; i <= ELECTRIC_COUNT; ++i) { - if (m_screenEdgeWindows[i] != None) { - screenEdgeWindows->append((Window*)m_screenEdgeWindows[i]); - } - } - return *screenEdgeWindows; + return m_screenEdgeWindows; } } //namespace diff --git a/screenedge.h b/screenedge.h index 205552977f..006866d65c 100644 --- a/screenedge.h +++ b/screenedge.h @@ -104,7 +104,7 @@ public: * Returns a QVector of all existing screen edge windows * @return all existing screen edge windows in a QVector */ - const QVector< Window* >& windows(); + const QVector< Window >& windows(); public Q_SLOTS: /** * Update the screen edge windows. Add new ones if the user specified @@ -119,8 +119,8 @@ private: */ void switchDesktop(ElectricBorder border, const QPoint& pos); + QVector< Window > m_screenEdgeWindows; ElectricBorder m_currentScreenEdge; - Window m_screenEdgeWindows[ELECTRIC_COUNT]; int m_screenEdgeLeft; int m_screenEdgeRight; int m_screenEdgeTop;