Reset Client::buttonDown if startMoveResize() failed

due to not being able to grab input. Visible with
resizing the shortcut configure dialog, which has grab.

svn path=/trunk/kdebase/kwin/; revision=269293
This commit is contained in:
Luboš Luňák 2003-11-24 14:24:34 +00:00
parent fe0ab6d200
commit 162c76cf46
3 changed files with 15 additions and 6 deletions

View file

@ -1315,7 +1315,8 @@ void Client::NETMoveResize( int x_root, int y_root, NET::Direction direction )
unrestrictedMoveResize = false;
mode = convert[ direction ];
setCursor( mode );
startMoveResize();
if( !startMoveResize())
buttonDown = false;
}
else if( direction == NET::KeyboardMove )
{ // ignore mouse coordinates given in the message, mouse position is used by the moving algorithm

View file

@ -1445,10 +1445,10 @@ static EatAllPaintEvents* eater = 0;
bool Client::startMoveResize()
{
assert( !moveResizeMode );
if( mode == Center )
setCursor( sizeAllCursor ); // change from arrow cursor if moving
if( !grabInput())
return false;
if( mode == Center )
setCursor( sizeAllCursor ); // change from arrow cursor if moving
if ( maximizeMode() != MaximizeRestore )
resetMaximize();
moveResizeMode = true;
@ -1514,7 +1514,13 @@ void Client::handleMoveResize( int x, int y, int x_root, int y_root )
{
QPoint p( QPoint( x, y ) - moveOffset );
if (p.manhattanLength() >= 6)
startMoveResize();
{
if( !startMoveResize())
{
buttonDown = false;
return;
}
}
else
return;
}

View file

@ -354,7 +354,8 @@ bool Client::performMouseCommand( Options::MouseCommand command, QPoint globalPo
invertedMoveOffset = rect().bottomRight() - moveOffset;
unrestrictedMoveResize = ( command == Options::MouseActivateRaiseAndUnrestrictedMove
|| command == Options::MouseUnrestrictedMove );
startMoveResize();
if( !startMoveResize())
buttonDown = false;
break;
}
case Options::MouseResize:
@ -380,7 +381,8 @@ bool Client::performMouseCommand( Options::MouseCommand command, QPoint globalPo
invertedMoveOffset = rect().bottomRight() - moveOffset;
unrestrictedMoveResize = ( command == Options::MouseUnrestrictedResize );
setCursor( mode );
startMoveResize();
if( !startMoveResize())
buttonDown = false;
break;
}
case Options::MouseMinimize: