Keep position in stacking order for deleted windows

Workspace::addDeleted swaps the Client with the Deleted in the
stacking order. For Unmanaged windows the Deleted is appended
to the stacking order which is the same layer.

When the deleted is closed the window is removed from the stacking
order.

The result is that a deleted window is no longer raised above all
other clients.

REVIEW: 104519
BUG: 158262
FIXED-IN: 4.9.0
This commit is contained in:
Martin Gräßlin 2012-04-09 11:06:44 +02:00
parent f0c6f06241
commit c4d8a54e98
4 changed files with 17 additions and 8 deletions

View file

@ -52,7 +52,7 @@ Deleted* Deleted::create(Toplevel* c)
{
Deleted* d = new Deleted(c->workspace());
d->copyToDeleted(c);
d->workspace()->addDeleted(d, Allowed);
d->workspace()->addDeleted(d, c, Allowed);
return d;
}

View file

@ -705,9 +705,6 @@ ToplevelList Workspace::xStackingOrder() const
if (Unmanaged* c = findUnmanaged(WindowMatchPredicate(windows[ i ])))
x_stacking.append(c);
}
// TODO: remove after stacking_order contains Deleted
foreach (Deleted * c, deleted)
x_stacking.append(c);
if (windows != NULL)
XFree(windows);
const_cast< Workspace* >(this)->checkUnredirect();

View file

@ -645,8 +645,6 @@ void Workspace::removeClient(Client* c, allowed_t)
// TODO: if marked client is removed, notify the marked list
clients.removeAll(c);
desktops.removeAll(c);
unconstrained_stacking_order.removeAll(c);
stacking_order.removeAll(c);
x_stacking_dirty = true;
for (int i = 1; i <= numberOfDesktops(); ++i)
focus_chain[i].removeAll(c);
@ -687,10 +685,22 @@ void Workspace::removeUnmanaged(Unmanaged* c, allowed_t)
x_stacking_dirty = true;
}
void Workspace::addDeleted(Deleted* c, allowed_t)
void Workspace::addDeleted(Deleted* c, Toplevel *orig, allowed_t)
{
assert(!deleted.contains(c));
deleted.append(c);
const int unconstraintedIndex = unconstrained_stacking_order.indexOf(orig);
if (unconstraintedIndex != -1) {
unconstrained_stacking_order.replace(unconstraintedIndex, c);
} else {
unconstrained_stacking_order.append(c);
}
const int index = stacking_order.indexOf(orig);
if (index != -1) {
stacking_order.replace(index, c);
} else {
stacking_order.append(c);
}
x_stacking_dirty = true;
}
@ -701,6 +711,8 @@ void Workspace::removeDeleted(Deleted* c, allowed_t)
scene->windowDeleted(c);
emit deletedRemoved(c);
deleted.removeAll(c);
unconstrained_stacking_order.removeAll(c);
stacking_order.removeAll(c);
x_stacking_dirty = true;
}

View file

@ -481,7 +481,7 @@ public:
void removeUnmanaged(Unmanaged*, allowed_t); // Only called from Unmanaged::release()
void removeDeleted(Deleted*, allowed_t);
void addDeleted(Deleted*, allowed_t);
void addDeleted(Deleted*, Toplevel*, allowed_t);
bool checkStartupNotification(Window w, KStartupInfoId& id, KStartupInfoData& data);