From 162c76cf462c79724f8f0bfd48322832ea036f5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Mon, 24 Nov 2003 14:24:34 +0000 Subject: [PATCH] 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 --- events.cpp | 3 ++- geometry.cpp | 12 +++++++++--- useractions.cpp | 6 ++++-- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/events.cpp b/events.cpp index c6aad257b9..63c7254adc 100644 --- a/events.cpp +++ b/events.cpp @@ -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 diff --git a/geometry.cpp b/geometry.cpp index f05cb86da3..862cf1726a 100644 --- a/geometry.cpp +++ b/geometry.cpp @@ -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; } diff --git a/useractions.cpp b/useractions.cpp index 3a50138cf8..d08073acc5 100644 --- a/useractions.cpp +++ b/useractions.cpp @@ -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: