From 54c264bba04c0f1d983b7177f19ec8b34c0a31e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Sun, 14 Mar 2010 16:18:57 +0000 Subject: [PATCH] Rearrange windows when the gemoetry changes in both pw and dg in pw mode. BUG: 228829 svn path=/trunk/KDE/kdebase/workspace/; revision=1103206 --- effects/desktopgrid/desktopgrid.cpp | 25 +++++++++++++++++++++++ effects/desktopgrid/desktopgrid.h | 1 + effects/presentwindows/presentwindows.cpp | 10 +++++++++ effects/presentwindows/presentwindows.h | 1 + 4 files changed, 37 insertions(+) diff --git a/effects/desktopgrid/desktopgrid.cpp b/effects/desktopgrid/desktopgrid.cpp index 159a5e8e74..57271d9e35 100644 --- a/effects/desktopgrid/desktopgrid.cpp +++ b/effects/desktopgrid/desktopgrid.cpp @@ -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; inumberOfDesktops(); 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 diff --git a/effects/desktopgrid/desktopgrid.h b/effects/desktopgrid/desktopgrid.h index 0e126cbf82..a23a7e40d8 100644 --- a/effects/desktopgrid/desktopgrid.h +++ b/effects/desktopgrid/desktopgrid.h @@ -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 ); diff --git a/effects/presentwindows/presentwindows.cpp b/effects/presentwindows/presentwindows.cpp index 542cfb7a40..0ff8ccb26e 100644 --- a/effects/presentwindows/presentwindows.cpp +++ b/effects/presentwindows/presentwindows.cpp @@ -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 ) ) diff --git a/effects/presentwindows/presentwindows.h b/effects/presentwindows/presentwindows.h index 09005f1da2..82ff77020a 100644 --- a/effects/presentwindows/presentwindows.h +++ b/effects/presentwindows/presentwindows.h @@ -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 );