diff --git a/composite.cpp b/composite.cpp --- a/composite.cpp +++ b/composite.cpp @@ -960,13 +960,6 @@ Compositor::self()->scene()->addToplevel(this); - // With unmanaged windows there is a race condition between the client painting the window - // and us setting up damage tracking. If the client wins we won't get a damage event even - // though the window has been painted. To avoid this we mark the whole window as damaged - // and schedule a repaint immediately after creating the damage object. - if (dynamic_cast(this)) - addDamageFull(); - return true; } diff --git a/unmanaged.h b/unmanaged.h --- a/unmanaged.h +++ b/unmanaged.h @@ -49,6 +49,8 @@ NET::WindowType windowType(bool direct = false, int supported_types = 0) const; bool isOutline() const override; + bool setupCompositing() override; + public Q_SLOTS: void release(ReleaseReason releaseReason = ReleaseReason::Release); protected: diff --git a/unmanaged.cpp b/unmanaged.cpp --- a/unmanaged.cpp +++ b/unmanaged.cpp @@ -185,5 +185,20 @@ return nullptr; } +bool Unmanaged::setupCompositing() +{ + if (!Toplevel::setupCompositing()) { + return false; + } + + // With unmanaged windows there is a race condition between the client painting the window + // and us setting up damage tracking. If the client wins we won't get a damage event even + // though the window has been painted. To avoid this we mark the whole window as damaged + // and schedule a repaint immediately after creating the damage object. + addDamageFull(); + + return true; +} + } // namespace