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:
parent
ea17b3562c
commit
89aa8ee8db
5 changed files with 16 additions and 7 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -171,4 +171,10 @@ bool Shadow::updateShadow()
|
|||
return true;
|
||||
}
|
||||
|
||||
void Shadow::setToplevel(Toplevel *topLevel)
|
||||
{
|
||||
m_topLevel = topLevel;
|
||||
setParent(topLevel);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
|
7
shadow.h
7
shadow.h
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue