Use QVector<Window> for screen edge windows instead of Window array
The code was updated to use a QVector for the screen edge windows instead of an ordinary Window array. The getter method windows() was updated to return now this QVector. In the method propagateClients() in layers.cpp the newWindowStack QVector is filled by iteration through the screen edge windows and only adding Windows that are not None.
This commit is contained in:
parent
f73fb783ca
commit
cc43928a97
3 changed files with 11 additions and 12 deletions
|
@ -155,7 +155,12 @@ void Workspace::propagateClients(bool propagate_new_clients)
|
||||||
// it ensures that no client will be ever shown above override-redirect
|
// it ensures that no client will be ever shown above override-redirect
|
||||||
// windows (e.g. popups).
|
// windows (e.g. popups).
|
||||||
newWindowStack << (Window*)supportWindow->winId();
|
newWindowStack << (Window*)supportWindow->winId();
|
||||||
newWindowStack << m_screenEdge.windows();
|
QVectorIterator<Window> it(m_screenEdge.windows());
|
||||||
|
while (it.hasNext()) {
|
||||||
|
if ((Window)it.next() != None) {
|
||||||
|
newWindowStack << (Window*)⁢
|
||||||
|
}
|
||||||
|
}
|
||||||
for (int i = stacking_order.size() - 1; i >= 0; i--) {
|
for (int i = stacking_order.size() - 1; i >= 0; i--) {
|
||||||
if (stacking_order.at(i)->hiddenPreview()) {
|
if (stacking_order.at(i)->hiddenPreview()) {
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -48,10 +48,10 @@ namespace KWin {
|
||||||
|
|
||||||
ScreenEdge::ScreenEdge()
|
ScreenEdge::ScreenEdge()
|
||||||
: QObject(NULL)
|
: QObject(NULL)
|
||||||
|
, m_screenEdgeWindows(ELECTRIC_COUNT, None)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < ELECTRIC_COUNT; ++i) {
|
for (int i = 0; i < ELECTRIC_COUNT; ++i) {
|
||||||
m_screenEdgeReserved[i] = 0;
|
m_screenEdgeReserved[i] = 0;
|
||||||
m_screenEdgeWindows[i] = None;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -377,15 +377,9 @@ void ScreenEdge::raiseWindows()
|
||||||
delete [] windows;
|
delete [] windows;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QVector< Window* >& ScreenEdge::windows()
|
const QVector< Window >& ScreenEdge::windows()
|
||||||
{
|
{
|
||||||
QVector< Window* >* screenEdgeWindows = new QVector< Window* >();
|
return m_screenEdgeWindows;
|
||||||
for (int i = 0; i <= ELECTRIC_COUNT; ++i) {
|
|
||||||
if (m_screenEdgeWindows[i] != None) {
|
|
||||||
screenEdgeWindows->append((Window*)m_screenEdgeWindows[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return *screenEdgeWindows;
|
|
||||||
}
|
}
|
||||||
} //namespace
|
} //namespace
|
||||||
|
|
||||||
|
|
|
@ -104,7 +104,7 @@ public:
|
||||||
* Returns a QVector of all existing screen edge windows
|
* Returns a QVector of all existing screen edge windows
|
||||||
* @return all existing screen edge windows in a QVector
|
* @return all existing screen edge windows in a QVector
|
||||||
*/
|
*/
|
||||||
const QVector< Window* >& windows();
|
const QVector< Window >& windows();
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
/**
|
/**
|
||||||
* Update the screen edge windows. Add new ones if the user specified
|
* Update the screen edge windows. Add new ones if the user specified
|
||||||
|
@ -119,8 +119,8 @@ private:
|
||||||
*/
|
*/
|
||||||
void switchDesktop(ElectricBorder border, const QPoint& pos);
|
void switchDesktop(ElectricBorder border, const QPoint& pos);
|
||||||
|
|
||||||
|
QVector< Window > m_screenEdgeWindows;
|
||||||
ElectricBorder m_currentScreenEdge;
|
ElectricBorder m_currentScreenEdge;
|
||||||
Window m_screenEdgeWindows[ELECTRIC_COUNT];
|
|
||||||
int m_screenEdgeLeft;
|
int m_screenEdgeLeft;
|
||||||
int m_screenEdgeRight;
|
int m_screenEdgeRight;
|
||||||
int m_screenEdgeTop;
|
int m_screenEdgeTop;
|
||||||
|
|
Loading…
Reference in a new issue