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