Changeset View
Changeset View
Standalone View
Standalone View
composite.cpp
Show First 20 Lines • Show All 766 Lines • ▼ Show 20 Line(s) | 651 | { | |||
---|---|---|---|---|---|
767 | // would again add something pending. | 767 | // would again add something pending. | ||
768 | if (m_bufferSwapPending && m_scene->syncsToVBlank()) { | 768 | if (m_bufferSwapPending && m_scene->syncsToVBlank()) { | ||
769 | m_composeAtSwapCompletion = true; | 769 | m_composeAtSwapCompletion = true; | ||
770 | } else { | 770 | } else { | ||
771 | scheduleRepaint(); | 771 | scheduleRepaint(); | ||
772 | } | 772 | } | ||
773 | } | 773 | } | ||
774 | 774 | | |||
775 | template <class T> | ||||
776 | static bool repaintsPending(const QList<T*> &windows) | ||||
777 | { | ||||
778 | return std::any_of(windows.begin(), windows.end(), [] (T *t) { return !t->repaints().isEmpty(); }); | ||||
779 | } | ||||
780 | | ||||
775 | bool Compositor::windowRepaintsPending() const | 781 | bool Compositor::windowRepaintsPending() const | ||
776 | { | 782 | { | ||
777 | foreach (Toplevel * c, Workspace::self()->clientList()) | 783 | if (repaintsPending(Workspace::self()->clientList())) { | ||
778 | if (!c->repaints().isEmpty()) | | |||
779 | return true; | 784 | return true; | ||
780 | foreach (Toplevel * c, Workspace::self()->desktopList()) | 785 | } | ||
781 | if (!c->repaints().isEmpty()) | 786 | if (repaintsPending(Workspace::self()->desktopList())) { | ||
782 | return true; | 787 | return true; | ||
783 | foreach (Toplevel * c, Workspace::self()->unmanagedList()) | 788 | } | ||
784 | if (!c->repaints().isEmpty()) | 789 | if (repaintsPending(Workspace::self()->unmanagedList())) { | ||
785 | return true; | 790 | return true; | ||
786 | foreach (Toplevel * c, Workspace::self()->deletedList()) | 791 | } | ||
787 | if (!c->repaints().isEmpty()) | 792 | if (repaintsPending(Workspace::self()->deletedList())) { | ||
788 | return true; | 793 | return true; | ||
794 | } | ||||
789 | if (auto w = waylandServer()) { | 795 | if (auto w = waylandServer()) { | ||
790 | const auto &clients = w->clients(); | 796 | const auto &clients = w->clients(); | ||
791 | for (auto c : clients) { | 797 | auto test = [] (ShellClient *c) { | ||
792 | if (c->readyForPainting() && !c->repaints().isEmpty()) { | 798 | return c->readyForPainting() && !c->repaints().isEmpty(); | ||
799 | }; | ||||
800 | if (std::any_of(clients.begin(), clients.end(), test)) { | ||||
793 | return true; | 801 | return true; | ||
794 | } | 802 | } | ||
795 | } | | |||
796 | const auto &internalClients = w->internalClients(); | 803 | const auto &internalClients = w->internalClients(); | ||
797 | for (auto c : internalClients) { | 804 | auto internalTest = [] (ShellClient *c) { | ||
798 | if (c->isShown(true) && !c->repaints().isEmpty()) { | 805 | return c->isShown(true) && !c->repaints().isEmpty(); | ||
806 | }; | ||||
807 | if (std::any_of(internalClients.begin(), internalClients.end(), internalTest)) { | ||||
799 | return true; | 808 | return true; | ||
800 | } | 809 | } | ||
801 | } | 810 | } | ||
802 | } | | |||
803 | return false; | 811 | return false; | ||
804 | } | 812 | } | ||
805 | 813 | | |||
806 | void Compositor::setCompositeResetTimer(int msecs) | 814 | void Compositor::setCompositeResetTimer(int msecs) | ||
807 | { | 815 | { | ||
808 | compositeResetTimer.start(msecs); | 816 | compositeResetTimer.start(msecs); | ||
809 | } | 817 | } | ||
810 | 818 | | |||
▲ Show 20 Lines • Show All 403 Lines • Show Last 20 Lines |