Rearrange windows when the gemoetry changes in both pw and dg in pw mode.

BUG: 228829

svn path=/trunk/KDE/kdebase/workspace/; revision=1103206
This commit is contained in:
Martin Gräßlin 2010-03-14 16:18:57 +00:00
parent 42a0a12252
commit 54c264bba0
4 changed files with 37 additions and 0 deletions

View file

@ -419,6 +419,31 @@ void DesktopGridEffect::windowClosed( EffectWindow* w )
effects->addRepaintFull();
}
void DesktopGridEffect::windowGeometryShapeChanged( EffectWindow* w, const QRect& old )
{
Q_UNUSED( old )
if( !activated )
return;
if( w == windowMove && wasWindowMove )
return;
if( isUsingPresentWindows() )
{
if( w->isOnAllDesktops() )
{
for( int i=0; i<effects->numberOfDesktops(); i++ )
{
WindowMotionManager& manager = m_managers[i*effects->numScreens()+w->screen()];
m_proxy->calculateWindowTransformations(manager.managedWindows(), w->screen(), manager);
}
}
else
{
WindowMotionManager& manager = m_managers[(w->desktop()-1)*effects->numScreens()+w->screen()];
m_proxy->calculateWindowTransformations(manager.managedWindows(), w->screen(), manager);
}
}
}
void DesktopGridEffect::windowInputMouseEvent( Window, QEvent* e )
{
if(( e->type() != QEvent::MouseMove

View file

@ -46,6 +46,7 @@ class DesktopGridEffect
virtual void paintWindow( EffectWindow* w, int mask, QRegion region, WindowPaintData& data );
virtual void windowClosed( EffectWindow* w );
virtual void windowAdded( EffectWindow* w );
virtual void windowGeometryShapeChanged( EffectWindow* w, const QRect& old );
virtual void windowInputMouseEvent( Window w, QEvent* e );
virtual void grabbedKeyboardEvent( QKeyEvent* e );
virtual bool borderActivated( ElectricBorder border );

View file

@ -408,6 +408,16 @@ void PresentWindowsEffect::windowDeleted( EffectWindow *w )
m_motionManager.unmanage( w );
}
void PresentWindowsEffect::windowGeometryShapeChanged( EffectWindow* w, const QRect& old )
{
Q_UNUSED( old )
if( !m_activated )
return;
if( !m_windowData.contains( w ))
return;
rearrangeWindows();
}
bool PresentWindowsEffect::borderActivated( ElectricBorder border )
{
if( !m_borderActivate.contains( border ) && !m_borderActivateAll.contains( border ) )

View file

@ -79,6 +79,7 @@ class PresentWindowsEffect
virtual void windowAdded( EffectWindow *w );
virtual void windowClosed( EffectWindow *w );
virtual void windowDeleted( EffectWindow *w );
virtual void windowGeometryShapeChanged( EffectWindow* w, const QRect& old );
virtual bool borderActivated( ElectricBorder border );
virtual void windowInputMouseEvent( Window w, QEvent *e );
virtual void grabbedKeyboardEvent( QKeyEvent *e );