diff --git a/composite.cpp b/composite.cpp index 8e4f05379a..5625e8cb2c 100644 --- a/composite.cpp +++ b/composite.cpp @@ -649,17 +649,6 @@ void Compositor::performCompositing() win->getDamageRegionReply(); } - if (repaints_region.isEmpty() && !windowRepaintsPending()) { - m_scene->idle(); - m_timeSinceLastVBlank = fpsInterval - (options->vBlankTime() + 1); // means "start now" - // Note: It would seem here we should undo suspended unredirect, but when scenes need - // it for some reason, e.g. transformations or translucency, the next pass that does not - // need this anymore and paints normally will also reset the suspended unredirect. - // Otherwise the window would not be painted normally anyway. - compositeTimer.stop(); - return; - } - // Skip windows that are not yet ready for being painted and if screen is locked skip windows // that are neither lockscreen nor inputmethod windows. // @@ -735,43 +724,6 @@ void Compositor::performCompositing() } } -template -static bool repaintsPending(const QList &windows) -{ - return std::any_of(windows.begin(), windows.end(), - [](const T *t) { return t->wantsRepaint(); }); -} - -bool Compositor::windowRepaintsPending() const -{ - if (repaintsPending(Workspace::self()->clientList())) { - return true; - } - if (repaintsPending(Workspace::self()->unmanagedList())) { - return true; - } - if (repaintsPending(Workspace::self()->deletedList())) { - return true; - } - if (auto *server = waylandServer()) { - const auto &clients = server->clients(); - auto test = [](const AbstractClient *c) { - return c->readyForPainting() && c->wantsRepaint(); - }; - if (std::any_of(clients.begin(), clients.end(), test)) { - return true; - } - } - const auto &internalClients = workspace()->internalClients(); - auto internalTest = [] (const InternalClient *client) { - return client->isShown(true) && client->wantsRepaint(); - }; - if (std::any_of(internalClients.begin(), internalClients.end(), internalTest)) { - return true; - } - return false; -} - void Compositor::setCompositeTimer() { if (m_state != State::On) { diff --git a/composite.h b/composite.h index 114cd35cf7..3a6a50a93f 100644 --- a/composite.h +++ b/composite.h @@ -134,7 +134,6 @@ private: void cleanupX11(); void setCompositeTimer(); - bool windowRepaintsPending() const; void releaseCompositorSelection(); void deleteUnusedSupportProperties(); diff --git a/scene.cpp b/scene.cpp index 5764eea886..26d56c72e3 100644 --- a/scene.cpp +++ b/scene.cpp @@ -1173,17 +1173,6 @@ void Scene::Window::reallocRepaints() m_layerRepaints.fill(infiniteRegion()); } -static bool wantsRepaint_test(const QRegion ®ion) -{ - return !region.isEmpty(); -} - -bool Scene::Window::wantsRepaint() const -{ - return std::any_of(m_repaints.begin(), m_repaints.end(), wantsRepaint_test) || - std::any_of(m_layerRepaints.begin(), m_layerRepaints.end(), wantsRepaint_test); -} - //**************************************** // WindowPixmap //**************************************** diff --git a/scene.h b/scene.h index 42c998bc7e..59cb0168fd 100644 --- a/scene.h +++ b/scene.h @@ -358,7 +358,6 @@ public: void addLayerRepaint(const QRegion ®ion); QRegion repaints(int screen) const; void resetRepaints(int screen); - bool wantsRepaint() const; virtual QSharedPointer windowTexture() { return {}; diff --git a/toplevel.cpp b/toplevel.cpp index a693378065..3e697cc43b 100644 --- a/toplevel.cpp +++ b/toplevel.cpp @@ -489,14 +489,6 @@ void Toplevel::addWorkspaceRepaint(const QRegion ®ion) } } -bool Toplevel::wantsRepaint() const -{ - if (!effectWindow() || !effectWindow()->sceneWindow()) { - return false; - } - return effectWindow()->sceneWindow()->wantsRepaint(); -} - void Toplevel::setReadyForPainting() { if (!ready_for_painting) { diff --git a/toplevel.h b/toplevel.h index 76dd9f816b..c5e1ec85b4 100644 --- a/toplevel.h +++ b/toplevel.h @@ -463,7 +463,6 @@ public: void addWorkspaceRepaint(const QRect& r); void addWorkspaceRepaint(int x, int y, int w, int h); void addWorkspaceRepaint(const QRegion ®ion); - bool wantsRepaint() const; QRegion damage() const; void resetDamage(); EffectWindowImpl* effectWindow();