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
This commit is contained in:
parent
c898f96df3
commit
0db071c218
3 changed files with 17 additions and 7 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue