small fixes to resize handling with the keyboard with weird mousepointer positions
svn path=/trunk/kdebase/kwin/; revision=35958
This commit is contained in:
parent
935c0a4478
commit
83bd1cc680
1 changed files with 28 additions and 8 deletions
20
client.cpp
20
client.cpp
|
@ -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() ) {
|
||||||
|
if ( mode == TopLeft || mode == BottomLeft ) {
|
||||||
moveOffset.rx() += delta;
|
moveOffset.rx() += delta;
|
||||||
invertedMoveOffset.rx() += delta;
|
invertedMoveOffset.rx() += delta;
|
||||||
|
} else {
|
||||||
|
moveOffset.rx() -= delta;
|
||||||
|
invertedMoveOffset.rx() -= delta;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if ( isResize() && !resizeHorizontalDirectionFixed ) {
|
if ( isResize() && !resizeHorizontalDirectionFixed ) {
|
||||||
resizeHorizontalDirectionFixed = TRUE;
|
resizeHorizontalDirectionFixed = TRUE;
|
||||||
|
@ -1652,9 +1657,14 @@ 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() ) {
|
||||||
|
if ( mode == TopRight || mode == BottomRight ) {
|
||||||
|
moveOffset.rx() += delta;
|
||||||
|
invertedMoveOffset.rx() += delta;
|
||||||
|
} else {
|
||||||
moveOffset.rx() -= delta;
|
moveOffset.rx() -= delta;
|
||||||
invertedMoveOffset.rx() -= delta;
|
invertedMoveOffset.rx() -= delta;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if ( isResize() && !resizeHorizontalDirectionFixed ) {
|
if ( isResize() && !resizeHorizontalDirectionFixed ) {
|
||||||
resizeHorizontalDirectionFixed = TRUE;
|
resizeHorizontalDirectionFixed = TRUE;
|
||||||
if ( mode == BottomLeft )
|
if ( mode == BottomLeft )
|
||||||
|
@ -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() ) {
|
||||||
|
if ( mode == TopLeft || mode == TopRight ) {
|
||||||
moveOffset.ry() += delta;
|
moveOffset.ry() += delta;
|
||||||
invertedMoveOffset.ry() += delta;
|
invertedMoveOffset.ry() += delta;
|
||||||
|
} else {
|
||||||
|
moveOffset.ry() -= delta;
|
||||||
|
invertedMoveOffset.ry() -= delta;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if ( isResize() && !resizeVerticalDirectionFixed ) {
|
if ( isResize() && !resizeVerticalDirectionFixed ) {
|
||||||
resizeVerticalDirectionFixed = TRUE;
|
resizeVerticalDirectionFixed = TRUE;
|
||||||
|
@ -1684,9 +1699,14 @@ 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() ) {
|
||||||
|
if ( mode == BottomLeft || mode == BottomRight ) {
|
||||||
|
moveOffset.ry() += delta;
|
||||||
|
invertedMoveOffset.ry() += delta;
|
||||||
|
} else {
|
||||||
moveOffset.ry() -= delta;
|
moveOffset.ry() -= delta;
|
||||||
invertedMoveOffset.ry() -= delta;
|
invertedMoveOffset.ry() -= delta;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if ( isResize() && !resizeVerticalDirectionFixed ) {
|
if ( isResize() && !resizeVerticalDirectionFixed ) {
|
||||||
resizeVerticalDirectionFixed = TRUE;
|
resizeVerticalDirectionFixed = TRUE;
|
||||||
if ( mode == TopLeft )
|
if ( mode == TopLeft )
|
||||||
|
|
Loading…
Reference in a new issue