Allow moving of maximized windows to another desktop in desktop grid. As there is no real visual feedback the cursor is changed to the moving one.

FEATURE: 153931

svn path=/trunk/KDE/kdebase/workspace/; revision=950718
This commit is contained in:
Martin Gräßlin 2009-04-07 16:10:29 +00:00
parent ef6a6cbe0c
commit 93196e8a99

View file

@ -327,7 +327,8 @@ void DesktopGridEffect::windowInputMouseEvent( Window, QEvent* e )
if( !wasWindowMove ) // Activate on move
effects->activateWindow( windowMove );
wasWindowMove = true;
effects->moveWindow( windowMove, unscalePos( me->pos(), NULL ) + windowMoveDiff );
if( windowMove->isMovable() )
effects->moveWindow( windowMove, unscalePos( me->pos(), NULL ) + windowMoveDiff );
// TODO: Window snap
if( d != highlightedDesktop && !windowMove->isOnAllDesktops() )
effects->windowToDesktop( windowMove, d ); // Not true all desktop move
@ -341,8 +342,9 @@ void DesktopGridEffect::windowInputMouseEvent( Window, QEvent* e )
{
QRect rect;
EffectWindow* w = windowAt( me->pos());
if( w != NULL && w->isMovable())
if( w != NULL )
{ // Prepare it for moving
XDefineCursor( display(), input, QCursor( Qt::SizeAllCursor ).handle() );
windowMoveDiff = w->pos() - unscalePos( me->pos(), NULL );
windowMove = w;
effects->setElevatedWindow( windowMove, true );
@ -374,6 +376,7 @@ void DesktopGridEffect::windowInputMouseEvent( Window, QEvent* e )
effects->activateWindow( windowMove ); // Just in case it was deactivated
effects->setElevatedWindow( windowMove, false );
windowMove = NULL;
XDefineCursor( display(), input, QCursor( Qt::PointingHandCursor ).handle() );
}
wasWindowMove = false;
}