small fixes
svn path=/trunk/kdebase/kwin/; revision=44444
This commit is contained in:
parent
8724699214
commit
9926eb384a
1 changed files with 50 additions and 49 deletions
99
client.cpp
99
client.cpp
|
@ -1177,57 +1177,58 @@ bool Client::eventFilter( QObject *o, QEvent * e)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client::gravitate( bool invert ){
|
void Client::gravitate( bool invert )
|
||||||
int gravity, dx, dy;
|
{
|
||||||
dx = dy = 0;
|
int gravity, dx, dy;
|
||||||
|
dx = dy = 0;
|
||||||
|
|
||||||
gravity = NorthWestGravity;
|
gravity = NorthWestGravity;
|
||||||
if ( xSizeHint.flags & PWinGravity)
|
if ( xSizeHint.flags & PWinGravity)
|
||||||
gravity = xSizeHint.win_gravity;
|
gravity = xSizeHint.win_gravity;
|
||||||
|
|
||||||
switch (gravity) {
|
switch (gravity) {
|
||||||
case NorthWestGravity:
|
case NorthWestGravity:
|
||||||
dx = 0;
|
dx = 0;
|
||||||
dy = 0;
|
dy = 0;
|
||||||
break;
|
break;
|
||||||
case NorthGravity:
|
case NorthGravity:
|
||||||
dx = -windowWrapper()->x();
|
dx = -windowWrapper()->x();
|
||||||
dy = 0;
|
dy = 0;
|
||||||
break;
|
break;
|
||||||
case NorthEastGravity:
|
case NorthEastGravity:
|
||||||
dx = -( width() - windowWrapper()->width() );
|
dx = -( width() - windowWrapper()->width() );
|
||||||
dy = 0;
|
dy = 0;
|
||||||
break;
|
break;
|
||||||
case WestGravity:
|
case WestGravity:
|
||||||
dx = 0;
|
dx = 0;
|
||||||
dy = -windowWrapper()->y();
|
dy = -windowWrapper()->y();
|
||||||
break;
|
break;
|
||||||
case CenterGravity:
|
case CenterGravity:
|
||||||
case StaticGravity:
|
case StaticGravity:
|
||||||
dx = -windowWrapper()->x();
|
dx = -windowWrapper()->x();
|
||||||
dy = -windowWrapper()->y();
|
dy = -windowWrapper()->y();
|
||||||
break;
|
break;
|
||||||
case EastGravity:
|
case EastGravity:
|
||||||
dx = -( width() - windowWrapper()->width() );
|
dx = -( width() - windowWrapper()->width() );
|
||||||
dy = -windowWrapper()->y();
|
dy = -windowWrapper()->y();
|
||||||
break;
|
break;
|
||||||
case SouthWestGravity:
|
case SouthWestGravity:
|
||||||
dx = 0;
|
dx = 0;
|
||||||
dy = -( height() - windowWrapper()->height() );
|
dy = -( height() - windowWrapper()->height() );
|
||||||
break;
|
break;
|
||||||
case SouthGravity:
|
case SouthGravity:
|
||||||
dx = -windowWrapper()->x();
|
dx = -windowWrapper()->x();
|
||||||
dy = -( height() - windowWrapper()->height() );
|
dy = -( height() - windowWrapper()->height() );
|
||||||
break;
|
break;
|
||||||
case SouthEastGravity:
|
case SouthEastGravity:
|
||||||
dx = -( width() - windowWrapper()->width() - 1 );
|
dx = -( width() - windowWrapper()->width() - 1 );
|
||||||
dy = -( height() - windowWrapper()->height() - 1 );
|
dy = -( height() - windowWrapper()->height() - 1 );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (invert)
|
if (invert)
|
||||||
move( x() - dx, y() - dy );
|
move( x() - dx, y() - dy );
|
||||||
else
|
else
|
||||||
move( x() + dx, y() + dy );
|
move( x() + dx, y() + dy );
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|
Loading…
Reference in a new issue