284
void Workspace::raiseOrLowerClient(Client *c)
288
void Workspace::raiseOrLowerClient(AbstractClient *c)
287
Client* topmost = NULL;
291
AbstractClient* topmost = NULL;
288
292
// TODO Q_ASSERT( block_stacking_updates == 0 );
289
293
if (most_recently_raised && stacking_order.contains(most_recently_raised) &&
290
294
most_recently_raised->isShown(true) && c->isOnCurrentDesktop())
313
317
unconstrained_stacking_order.prepend(c);
314
318
if (!nogroup && c->isTransient()) {
315
319
// lower also all windows in the group, in their reversed stacking order
316
ClientList wins = ensureStackingOrder(c->group()->members());
320
ClientList wins = ensureStackingOrder(static_cast<Client*>(c)->group()->members());
317
321
for (int i = wins.size() - 1;
368
372
if (!nogroup && c->isTransient()) {
369
373
ClientList transients;
370
Client *transient_parent = c;
374
Client *transient_parent = static_cast<Client*>(c);
371
375
while ((transient_parent = transient_parent->transientFor()))
372
376
transients << transient_parent;
373
377
foreach (transient_parent, transients)
434
void Workspace::restack(Client* c, Client* under, bool force)
438
void Workspace::restack(AbstractClient* c, AbstractClient* under, bool force)
436
440
assert(unconstrained_stacking_order.contains(under));
437
if (!force && !Client::belongToSameApplication(under, c)) {
441
if (!force && !AbstractClient::belongToSameApplication(under, c)) {
438
442
// put in the stacking order below _all_ windows belonging to the active application
439
443
for (int i = 0; i < unconstrained_stacking_order.size(); ++i) {
440
Client *other = qobject_cast<Client*>(unconstrained_stacking_order.at(i));
441
if (other && other->layer() == c->layer() && Client::belongToSameApplication(under, other)) {
444
AbstractClient *other = qobject_cast<AbstractClient*>(unconstrained_stacking_order.at(i));
445
if (other && other->layer() == c->layer() && AbstractClient::belongToSameApplication(under, other)) {
442
446
under = (c == other) ? 0 : other;
773
785
sendSyntheticConfigureNotify();
776
void Client::setKeepAbove(bool b)
788
void Client::doSetKeepAbove()
778
b = rules()->checkKeepAbove(b);
779
if (b && !rules()->checkKeepBelow(false))
781
if (b == keepAbove()) {
782
// force hint change if different
783
if (bool(info->state() & NET::KeepAbove) != keepAbove())
784
info->setState(keepAbove() ? NET::KeepAbove : NET::States(0), NET::KeepAbove);
788
info->setState(keepAbove() ? NET::KeepAbove : NET::States(0), NET::KeepAbove);
789
workspace()->updateClientLayer(this);
790
updateWindowRules(Rules::Above);
792
790
// Update states of all other windows in this group
794
792
tabGroup()->updateStates(this, TabGroup::Layer);
795
emit keepAboveChanged(keep_above);
798
void Client::setKeepBelow(bool b)
795
void Client::doSetKeepBelow()
800
b = rules()->checkKeepBelow(b);
801
if (b && !rules()->checkKeepAbove(false))
803
if (b == keepBelow()) {
804
// force hint change if different
805
if (bool(info->state() & NET::KeepBelow) != keepBelow())
806
info->setState(keepBelow() ? NET::KeepBelow : NET::States(0), NET::KeepBelow);
810
info->setState(keepBelow() ? NET::KeepBelow : NET::States(0), NET::KeepBelow);
811
workspace()->updateClientLayer(this);
812
updateWindowRules(Rules::Below);
814
797
// Update states of all other windows in this group
816
799
tabGroup()->updateStates(this, TabGroup::Layer);
817
emit keepBelowChanged(keep_below);
820
802
Layer Client::layer() const
893
875
if (!isFullScreen())
896
const Client* ac = workspace()->mostRecentlyActivatedClient(); // instead of activeClient() - avoids flicker
878
const Client* ac = dynamic_cast<Client*>(workspace()->mostRecentlyActivatedClient()); // instead of activeClient() - avoids flicker
897
879
// according to NETWM spec implementation notes suggests
898
880
// "focused windows having state _NET_WM_STATE_FULLSCREEN" to be on the highest layer.
899
881
// we'll also take the screen into account