Fix #31484 - snapping to workarea edges is already done by snapping

to windows, snap also to screen edges.
CCMAIL: 31484-done@bugs.kde.org

svn path=/trunk/kdebase/kwin/; revision=257737
This commit is contained in:
Luboš Luňák 2003-10-10 13:09:54 +00:00
parent b8db522f64
commit 1751ac0880
3 changed files with 4 additions and 2 deletions

View file

@ -155,7 +155,8 @@ QRect Workspace::clientArea( clientAreaOption opt, const QPoint& p, int desktop
break;
}
if( workarea[ desktop ].isNull() || opt == FullArea || opt == MaximizeFullArea || opt == ScreenArea )
if( workarea[ desktop ].isNull() || opt == FullArea || opt == MaximizeFullArea
|| opt == ScreenArea || opt == MovementArea )
return rect;
return workarea[ desktop ].intersect(rect);

View file

@ -504,6 +504,7 @@ void Client::growHorizontal()
{
int newright = workspace()->packPositionRight( this, geom.right() + xSizeHint.width_inc - 1, true );
// check that it hasn't grown outside of the area, due to size increments
// TODO this may be wrong?
if( workspace()->clientArea( MovementArea,
QPoint(( x() + newright ) / 2, geometry().center().y()), desktop()).right() >= newright )
geom.setRight( newright );

View file

@ -79,7 +79,7 @@ enum ForceGeometry_t { NormalGeometrySet, ForceGeometrySet };
enum clientAreaOption
{
PlacementArea, // geometry where a window will be initially placed after being mapped
MovementArea, // ??? window movement snapping area?
MovementArea, // ??? window movement snapping area? ignore struts
MaximizeArea, // geometry to which a window will be maximized
MaximizeFullArea, // like MaximizeArea, but ignore struts - used e.g. for fullscreening
WorkArea, // whole workarea (all screens together)