Changeset View
Changeset View
Standalone View
Standalone View
workspace.cpp
Show First 20 Lines • Show All 761 Lines • ▼ Show 20 Line(s) | |||||
762 | { | 762 | { | ||
763 | // TODO: What if Client's transiency/group changes? should this be called too? (I'm paranoid, am I not?) | 763 | // TODO: What if Client's transiency/group changes? should this be called too? (I'm paranoid, am I not?) | ||
764 | if (!options->isHideUtilityWindowsForInactive()) { | 764 | if (!options->isHideUtilityWindowsForInactive()) { | ||
765 | for (ClientList::ConstIterator it = clients.constBegin(); it != clients.constEnd(); ++it) | 765 | for (ClientList::ConstIterator it = clients.constBegin(); it != clients.constEnd(); ++it) | ||
766 | if (!(*it)->tabGroup() || (*it)->tabGroup()->current() == *it) | 766 | if (!(*it)->tabGroup() || (*it)->tabGroup()->current() == *it) | ||
767 | (*it)->hideClient(false); | 767 | (*it)->hideClient(false); | ||
768 | return; | 768 | return; | ||
769 | } | 769 | } | ||
770 | const Group* group = NULL; | 770 | const Group* group = nullptr; | ||
771 | const Client* client = dynamic_cast<Client*>(active_client); | 771 | auto client = active_client; | ||
772 | // Go up in transiency hiearchy, if the top is found, only tool transients for the top mainwindow | 772 | // Go up in transiency hiearchy, if the top is found, only tool transients for the top mainwindow | ||
773 | // will be shown; if a group transient is group, all tools in the group will be shown | 773 | // will be shown; if a group transient is group, all tools in the group will be shown | ||
774 | while (client != NULL) { | 774 | while (client != nullptr) { | ||
775 | if (!client->isTransient()) | 775 | if (!client->isTransient()) | ||
776 | break; | 776 | break; | ||
777 | if (client->groupTransient()) { | 777 | if (client->groupTransient()) { | ||
778 | group = client->group(); | 778 | group = client->group(); | ||
779 | break; | 779 | break; | ||
780 | } | 780 | } | ||
781 | client = dynamic_cast<const Client*>(client->transientFor()); | 781 | client = client->transientFor(); | ||
782 | } | 782 | } | ||
783 | // Use stacking order only to reduce flicker, it doesn't matter if block_stacking_updates == 0, | 783 | // Use stacking order only to reduce flicker, it doesn't matter if block_stacking_updates == 0, | ||
784 | // I.e. if it's not up to date | 784 | // I.e. if it's not up to date | ||
785 | 785 | | |||
786 | // SELI TODO: But maybe it should - what if a new client has been added that's not in stacking order yet? | 786 | // SELI TODO: But maybe it should - what if a new client has been added that's not in stacking order yet? | ||
787 | ClientList to_show, to_hide; | 787 | QVector<AbstractClient*> to_show, to_hide; | ||
788 | for (ToplevelList::ConstIterator it = stacking_order.constBegin(); | 788 | for (ToplevelList::ConstIterator it = stacking_order.constBegin(); | ||
789 | it != stacking_order.constEnd(); | 789 | it != stacking_order.constEnd(); | ||
790 | ++it) { | 790 | ++it) { | ||
791 | Client *c = qobject_cast<Client*>(*it); | 791 | auto c = qobject_cast<AbstractClient*>(*it); | ||
792 | if (!c) { | 792 | if (!c) { | ||
793 | continue; | 793 | continue; | ||
794 | } | 794 | } | ||
795 | if (c->isUtility() || c->isMenu() || c->isToolbar()) { | 795 | if (c->isUtility() || c->isMenu() || c->isToolbar()) { | ||
796 | bool show = true; | 796 | bool show = true; | ||
797 | if (!c->isTransient()) { | 797 | if (!c->isTransient()) { | ||
798 | if (c->group()->members().count() == 1) // Has its own group, keep always visible | 798 | if (!c->group() || c->group()->members().count() == 1) // Has its own group, keep always visible | ||
799 | show = true; | 799 | show = true; | ||
800 | else if (client != NULL && c->group() == client->group()) | 800 | else if (client != NULL && c->group() == client->group()) | ||
801 | show = true; | 801 | show = true; | ||
802 | else | 802 | else | ||
803 | show = false; | 803 | show = false; | ||
804 | } else { | 804 | } else { | ||
805 | if (group != NULL && c->group() == group) | 805 | if (group != NULL && c->group() == group) | ||
806 | show = true; | 806 | show = true; | ||
Show All 22 Lines | |||||
829 | } | 829 | } | ||
830 | } // First show new ones, then hide | 830 | } // First show new ones, then hide | ||
831 | for (int i = to_show.size() - 1; | 831 | for (int i = to_show.size() - 1; | ||
832 | i >= 0; | 832 | i >= 0; | ||
833 | --i) // From topmost | 833 | --i) // From topmost | ||
834 | // TODO: Since this is in stacking order, the order of taskbar entries changes :( | 834 | // TODO: Since this is in stacking order, the order of taskbar entries changes :( | ||
835 | to_show.at(i)->hideClient(false); | 835 | to_show.at(i)->hideClient(false); | ||
836 | if (also_hide) { | 836 | if (also_hide) { | ||
837 | for (ClientList::ConstIterator it = to_hide.constBegin(); | 837 | for (auto it = to_hide.constBegin(); | ||
838 | it != to_hide.constEnd(); | 838 | it != to_hide.constEnd(); | ||
839 | ++it) // From bottommost | 839 | ++it) // From bottommost | ||
840 | (*it)->hideClient(true); | 840 | (*it)->hideClient(true); | ||
841 | updateToolWindowsTimer.stop(); | 841 | updateToolWindowsTimer.stop(); | ||
842 | } else // setActiveClient() is after called with NULL client, quickly followed | 842 | } else // setActiveClient() is after called with NULL client, quickly followed | ||
843 | // by setting a new client, which would result in flickering | 843 | // by setting a new client, which would result in flickering | ||
844 | resetUpdateToolWindowsTimer(); | 844 | resetUpdateToolWindowsTimer(); | ||
845 | } | 845 | } | ||
▲ Show 20 Lines • Show All 432 Lines • ▼ Show 20 Line(s) | 1276 | for (int i = stacking_order.count() - 1; i > -1; --i) { | |||
1278 | if (c && c->isOnCurrentDesktop()) { | 1278 | if (c && c->isOnCurrentDesktop()) { | ||
1279 | if (c->isDock()) { | 1279 | if (c->isDock()) { | ||
1280 | c->updateLayer(); | 1280 | c->updateLayer(); | ||
1281 | } else if (c->isDesktop() && c->isShown(true)) { | 1281 | } else if (c->isDesktop() && c->isShown(true)) { | ||
1282 | c->updateLayer(); | 1282 | c->updateLayer(); | ||
1283 | lowerClient(c); | 1283 | lowerClient(c); | ||
1284 | if (!topDesk) | 1284 | if (!topDesk) | ||
1285 | topDesk = c; | 1285 | topDesk = c; | ||
1286 | if (Client *client = qobject_cast<Client*>(c)) { | 1286 | if (auto group = c->group()) { | ||
1287 | foreach (Client *cm, client->group()->members()) { | 1287 | foreach (Client *cm, group->members()) { | ||
1288 | cm->updateLayer(); | 1288 | cm->updateLayer(); | ||
1289 | } | 1289 | } | ||
1290 | } | 1290 | } | ||
1291 | } | 1291 | } | ||
1292 | } | 1292 | } | ||
1293 | } | 1293 | } | ||
1294 | } // ~StackingUpdatesBlocker | 1294 | } // ~StackingUpdatesBlocker | ||
1295 | 1295 | | |||
▲ Show 20 Lines • Show All 478 Lines • Show Last 20 Lines |