Fix repainting of shadow after window closes

Unmanaged needs to repaint the complete geometry including shadow
when it ends compositing. Therefore we need to track the shadow
passing to deleted correctly. Disadvantage: when turning off
compositing the shadow is kept. Need to solve in a better way!
This commit is contained in:
Martin Gräßlin 2011-04-01 21:49:44 +02:00
parent ea17b3562c
commit 89aa8ee8db
5 changed files with 16 additions and 7 deletions

View file

@ -690,10 +690,6 @@ void Toplevel::finishCompositing()
damage_region = QRegion();
repaints_region = QRegion();
effect_window = NULL;
if (hasShadow()) {
delete m_shadow;
m_shadow = NULL;
}
#endif
}

View file

@ -171,4 +171,10 @@ bool Shadow::updateShadow()
return true;
}
void Shadow::setToplevel(Toplevel *topLevel)
{
m_topLevel = topLevel;
setParent(topLevel);
}
} // namespace

View file

@ -85,6 +85,13 @@ public:
**/
static Shadow *createShadow(Toplevel *toplevel);
/**
* Reparents the shadow to @p toplevel.
* Used when a window is deleted.
* @param toplevel The new parent
**/
void setToplevel(Toplevel *toplevel);
protected:
Shadow(Toplevel *toplevel);
enum ShadowElements {

View file

@ -135,8 +135,7 @@ void Toplevel::copyToDeleted(Toplevel* c)
c->window_pix = None;
if (c->hasShadow()) {
m_shadow = c->m_shadow;
c->m_shadow->setParent(this);
c->m_shadow = NULL;
m_shadow->setToplevel(this);
}
}
@ -145,6 +144,7 @@ void Toplevel::copyToDeleted(Toplevel* c)
void Toplevel::disownDataPassedToDeleted()
{
info = NULL;
m_shadow = NULL;
}
QRect Toplevel::visibleRect() const

View file

@ -92,7 +92,7 @@ void Unmanaged::release()
XShapeSelectInput(display(), window(), NoEventMask);
XSelectInput(display(), window(), NoEventMask);
}
addWorkspaceRepaint(geometry());
addWorkspaceRepaint(visibleRect());
disownDataPassedToDeleted();
del->unrefWindow();
deleteUnmanaged(this, Allowed);