Make it possible to move windows across screens in desktop grid.

BUG: 213845

svn path=/trunk/KDE/kdebase/workspace/; revision=1051265
This commit is contained in:
Martin Gräßlin 2009-11-19 08:34:28 +00:00
parent 84e7363aa0
commit 2ff73028a0
4 changed files with 13 additions and 1 deletions

View file

@ -458,6 +458,13 @@ void EffectsHandlerImpl::windowToDesktop( EffectWindow* w, int desktop )
Workspace::self()->sendClientToDesktop( cl, desktop, true );
}
void EffectsHandlerImpl::windowToScreen( EffectWindow* w, int screen )
{
Client* cl = dynamic_cast< Client* >( static_cast<EffectWindowImpl*>(w)->window());
if( cl && !cl->isDesktop() && !cl->isDock() && !cl->isTopMenu())
Workspace::self()->sendClientToScreen( cl, screen );
}
void EffectsHandlerImpl::setShowingDesktop( bool showing )
{
Workspace::self()->setShowingDesktop( showing );

View file

@ -55,6 +55,7 @@ class EffectsHandlerImpl : public EffectsHandler
virtual EffectWindow* activeWindow() const;
virtual void moveWindow( EffectWindow* w, const QPoint& pos, bool snap = false, double snapAdjust = 1.0 );
virtual void windowToDesktop( EffectWindow* w, int desktop );
virtual void windowToScreen( EffectWindow* w, int screen );
virtual void setShowingDesktop( bool showing );
virtual int currentDesktop() const;

View file

@ -451,6 +451,9 @@ void DesktopGridEffect::windowInputMouseEvent( Window, QEvent* e )
if( d != highlightedDesktop && !windowMove->isOnAllDesktops() )
{
effects->windowToDesktop( windowMove, d ); // Not true all desktop move
const int screen = effects->screenNumber( me->pos() );
if( screen != windowMove->screen() )
effects->windowToScreen( windowMove, screen );
}
effects->addRepaintFull();
}

View file

@ -170,7 +170,7 @@ X-KDE-Library=kwin4_effect_cooleffect
#define KWIN_EFFECT_API_MAKE_VERSION( major, minor ) (( major ) << 8 | ( minor ))
#define KWIN_EFFECT_API_VERSION_MAJOR 0
#define KWIN_EFFECT_API_VERSION_MINOR 107
#define KWIN_EFFECT_API_VERSION_MINOR 108
#define KWIN_EFFECT_API_VERSION KWIN_EFFECT_API_MAKE_VERSION( \
KWIN_EFFECT_API_VERSION_MAJOR, KWIN_EFFECT_API_VERSION_MINOR )
@ -563,6 +563,7 @@ class KWIN_EXPORT EffectsHandler
virtual EffectWindow* activeWindow() const = 0 ;
virtual void moveWindow( EffectWindow* w, const QPoint& pos, bool snap = false, double snapAdjust = 1.0 ) = 0;
virtual void windowToDesktop( EffectWindow* w, int desktop ) = 0;
virtual void windowToScreen( EffectWindow* w, int desktop ) = 0;
virtual void setShowingDesktop( bool showing ) = 0;
// Desktops