diff --git a/client.cpp b/client.cpp index b5f3cebed5..57dfd0bb67 100644 --- a/client.cpp +++ b/client.cpp @@ -1588,7 +1588,10 @@ void Client::setCursor( Position m ) setCursor( sizeHorCursor ); break; default: - setCursor( arrowCursor ); + if( buttonDown ) + setCursor( sizeAllCursor ); + else + setCursor( arrowCursor ); break; } } diff --git a/events.cpp b/events.cpp index d256588c7f..2a184b2a29 100644 --- a/events.cpp +++ b/events.cpp @@ -1184,6 +1184,7 @@ void Client::processDecorationButtonPress( int button, int /*state*/, int x, int moveOffset = QPoint( x, y ); invertedMoveOffset = rect().bottomRight() - moveOffset; unrestrictedMoveResize = false; + setCursor( mode ); // update to sizeAllCursor if about to move } performMouseCommand( com, QPoint( x_root, y_root )); } @@ -1237,8 +1238,8 @@ bool Client::buttonReleaseEvent( Window w, int /*button*/, int state, int x, int // mouse position is still relative to old Client position, adjust it QPoint mousepos( x_root - x, y_root - y ); mode = mousePosition( mousepos ); - setCursor( mode ); } + setCursor( mode ); } return true; } @@ -1424,7 +1425,10 @@ void Client::NETMoveResize( int x_root, int y_root, NET::Direction direction ) mode = convert[ direction ]; setCursor( mode ); if( !startMoveResize()) + { buttonDown = false; + setCursor( mode ); + } } else if( direction == NET::KeyboardMove ) { // ignore mouse coordinates given in the message, mouse position is used by the moving algorithm @@ -1467,10 +1471,12 @@ void Client::keyPressEvent( uint key_code ) case Key_Enter: finishMoveResize( false ); buttonDown = FALSE; + setCursor( mode ); break; case Key_Escape: finishMoveResize( true ); buttonDown = FALSE; + setCursor( mode ); break; default: return; diff --git a/geometry.cpp b/geometry.cpp index 5fed2aacee..f851b6ccb7 100644 --- a/geometry.cpp +++ b/geometry.cpp @@ -1704,8 +1704,6 @@ bool Client::startMoveResize() if( QApplication::activePopupWidget() != NULL ) return false; // popups have grab bool has_grab = false; - if( mode == PositionCenter ) - setCursor( sizeAllCursor ); // change from arrow cursor if moving // This reportedly improves smoothness of the moveresize operation, // something with Enter/LeaveNotify events, looks like XFree performance problem or something *shrug* // (http://lists.kde.org/?t=107302193400001&r=1&w=2) @@ -1844,6 +1842,7 @@ void Client::handleMoveResize( int x, int y, int x_root, int y_root ) if( !startMoveResize()) { buttonDown = false; + setCursor( mode ); return; } } diff --git a/useractions.cpp b/useractions.cpp index 78386a9f99..7e9eda1b8c 100644 --- a/useractions.cpp +++ b/useractions.cpp @@ -355,8 +355,12 @@ bool Client::performMouseCommand( Options::MouseCommand command, QPoint globalPo invertedMoveOffset = rect().bottomRight() - moveOffset; unrestrictedMoveResize = ( command == Options::MouseActivateRaiseAndUnrestrictedMove || command == Options::MouseUnrestrictedMove ); + setCursor( mode ); if( !startMoveResize()) + { buttonDown = false; + setCursor( mode ); + } break; } case Options::MouseResize: @@ -383,7 +387,10 @@ bool Client::performMouseCommand( Options::MouseCommand command, QPoint globalPo unrestrictedMoveResize = ( command == Options::MouseUnrestrictedResize ); setCursor( mode ); if( !startMoveResize()) + { buttonDown = false; + setCursor( mode ); + } break; } case Options::MouseMinimize: