Make elevatedWindows() return list of EffectWindow pointers instead

of Toplevel ones. This makes it independant of the Toplevel objects
  and fixes a crash when an elevated window is closed.

svn path=/trunk/KDE/kdebase/workspace/; revision=760802
This commit is contained in:
Rivo Laks 2008-01-13 13:00:15 +00:00
parent 66f14cc855
commit 0d64af45ce
3 changed files with 10 additions and 10 deletions

View file

@ -301,10 +301,11 @@ void Workspace::performCompositing()
windows.append( c ); windows.append( c );
foreach( Deleted* c, deleted ) // TODO remember stacking order somehow foreach( Deleted* c, deleted ) // TODO remember stacking order somehow
windows.append( c ); windows.append( c );
foreach( Toplevel* c, static_cast< EffectsHandlerImpl* >( effects )->elevatedWindows()) foreach( EffectWindow* c, static_cast< EffectsHandlerImpl* >( effects )->elevatedWindows())
{ {
windows.removeAll( c ); Toplevel* t = static_cast< EffectWindowImpl* >( c )->window();
windows.append( c ); windows.removeAll( t );
windows.append( t );
} }
foreach( Toplevel* c, windows ) foreach( Toplevel* c, windows )
{ // This could be possibly optimized WRT obscuring, but that'd need being already { // This could be possibly optimized WRT obscuring, but that'd need being already

View file

@ -203,7 +203,7 @@ void EffectsHandlerImpl::windowDeleted( EffectWindow* c )
foreach( EffectPair ep, loaded_effects ) foreach( EffectPair ep, loaded_effects )
ep.second->windowDeleted( c ); ep.second->windowDeleted( c );
Toplevel* c2 = static_cast< EffectWindowImpl* >( c )->window(); Toplevel* c2 = static_cast< EffectWindowImpl* >( c )->window();
elevated_windows.removeAll( c2 ); elevated_windows.removeAll( c );
} }
void EffectsHandlerImpl::windowClosed( EffectWindow* c ) void EffectsHandlerImpl::windowClosed( EffectWindow* c )
@ -450,10 +450,9 @@ EffectWindowList EffectsHandlerImpl::stackingOrder() const
void EffectsHandlerImpl::setElevatedWindow( EffectWindow* w, bool set ) void EffectsHandlerImpl::setElevatedWindow( EffectWindow* w, bool set )
{ {
Toplevel* c = static_cast< EffectWindowImpl* >( w )->window(); elevated_windows.removeAll( w );
elevated_windows.removeAll( c );
if( set ) if( set )
elevated_windows.append( c ); elevated_windows.append( w );
} }
void EffectsHandlerImpl::setTabBoxWindow(EffectWindow* w) void EffectsHandlerImpl::setTabBoxWindow(EffectWindow* w)

View file

@ -142,7 +142,7 @@ class EffectsHandlerImpl : public EffectsHandler
void reloadEffect( const QString& name ); void reloadEffect( const QString& name );
bool isEffectLoaded( const QString& name ); bool isEffectLoaded( const QString& name );
ToplevelList elevatedWindows() const; QList<EffectWindow*> elevatedWindows() const;
protected: protected:
KLibrary* findEffectLibrary( KService* service ); KLibrary* findEffectLibrary( KService* service );
@ -151,7 +151,7 @@ class EffectsHandlerImpl : public EffectsHandler
Effect* keyboard_grab_effect; Effect* keyboard_grab_effect;
QStack<GLRenderTarget*> render_targets; QStack<GLRenderTarget*> render_targets;
Effect* fullscreen_effect; Effect* fullscreen_effect;
ToplevelList elevated_windows; QList<EffectWindow*> elevated_windows;
QMultiMap< int, EffectPair > effect_order; QMultiMap< int, EffectPair > effect_order;
QHash< long, int > registered_atoms; QHash< long, int > registered_atoms;
}; };
@ -248,7 +248,7 @@ class EffectWindowGroupImpl
inline inline
ToplevelList EffectsHandlerImpl::elevatedWindows() const QList<EffectWindow*> EffectsHandlerImpl::elevatedWindows() const
{ {
return elevated_windows; return elevated_windows;
} }