Commit 0db071c2 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii

Move Unmanaged-specific hack away from Toplevel::setupCompositing

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D20590
parent c898f96d
......@@ -960,13 +960,6 @@ bool Toplevel::setupCompositing()
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<Unmanaged*>(this))
addDamageFull();
return true;
}
......
......@@ -185,5 +185,20 @@ QWindow *Unmanaged::findInternalWindow() const
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
......@@ -49,6 +49,8 @@ public:
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:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment