small fixes to resize handling with the keyboard with weird mousepointer positions

svn path=/trunk/kdebase/kwin/; revision=35958
This commit is contained in:
Matthias Ettrich 1999-12-06 15:44:29 +00:00
parent 935c0a4478
commit 83bd1cc680

View file

@ -1636,8 +1636,13 @@ void Client::keyPressEvent( QKeyEvent * e )
case Key_Left: case Key_Left:
pos.rx() -= delta; pos.rx() -= delta;
if ( pos.x() <= workspace()->geometry().left() ) { if ( pos.x() <= workspace()->geometry().left() ) {
moveOffset.rx() += delta; if ( mode == TopLeft || mode == BottomLeft ) {
invertedMoveOffset.rx() += delta; moveOffset.rx() += delta;
invertedMoveOffset.rx() += delta;
} else {
moveOffset.rx() -= delta;
invertedMoveOffset.rx() -= delta;
}
} }
if ( isResize() && !resizeHorizontalDirectionFixed ) { if ( isResize() && !resizeHorizontalDirectionFixed ) {
resizeHorizontalDirectionFixed = TRUE; resizeHorizontalDirectionFixed = TRUE;
@ -1652,8 +1657,13 @@ void Client::keyPressEvent( QKeyEvent * e )
case Key_Right: case Key_Right:
pos.rx() += delta; pos.rx() += delta;
if ( pos.x() >= workspace()->geometry().right() ) { if ( pos.x() >= workspace()->geometry().right() ) {
moveOffset.rx() -= delta; if ( mode == TopRight || mode == BottomRight ) {
invertedMoveOffset.rx() -= delta; moveOffset.rx() += delta;
invertedMoveOffset.rx() += delta;
} else {
moveOffset.rx() -= delta;
invertedMoveOffset.rx() -= delta;
}
} }
if ( isResize() && !resizeHorizontalDirectionFixed ) { if ( isResize() && !resizeHorizontalDirectionFixed ) {
resizeHorizontalDirectionFixed = TRUE; resizeHorizontalDirectionFixed = TRUE;
@ -1668,8 +1678,13 @@ void Client::keyPressEvent( QKeyEvent * e )
case Key_Up: case Key_Up:
pos.ry() -= delta; pos.ry() -= delta;
if ( pos.y() <= workspace()->geometry().top() ) { if ( pos.y() <= workspace()->geometry().top() ) {
moveOffset.ry() += delta; if ( mode == TopLeft || mode == TopRight ) {
invertedMoveOffset.ry() += delta; moveOffset.ry() += delta;
invertedMoveOffset.ry() += delta;
} else {
moveOffset.ry() -= delta;
invertedMoveOffset.ry() -= delta;
}
} }
if ( isResize() && !resizeVerticalDirectionFixed ) { if ( isResize() && !resizeVerticalDirectionFixed ) {
resizeVerticalDirectionFixed = TRUE; resizeVerticalDirectionFixed = TRUE;
@ -1684,8 +1699,13 @@ void Client::keyPressEvent( QKeyEvent * e )
case Key_Down: case Key_Down:
pos.ry() += delta; pos.ry() += delta;
if ( pos.y() >= workspace()->geometry().bottom() ) { if ( pos.y() >= workspace()->geometry().bottom() ) {
moveOffset.ry() -= delta; if ( mode == BottomLeft || mode == BottomRight ) {
invertedMoveOffset.ry() -= delta; moveOffset.ry() += delta;
invertedMoveOffset.ry() += delta;
} else {
moveOffset.ry() -= delta;
invertedMoveOffset.ry() -= delta;
}
} }
if ( isResize() && !resizeVerticalDirectionFixed ) { if ( isResize() && !resizeVerticalDirectionFixed ) {
resizeVerticalDirectionFixed = TRUE; resizeVerticalDirectionFixed = TRUE;