From 1751ac08803147ac491a2d74f690e49433e26994 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Fri, 10 Oct 2003 13:09:54 +0000 Subject: [PATCH] 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 --- geometry.cpp | 3 ++- placement.cpp | 1 + utils.h | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/geometry.cpp b/geometry.cpp index 4cf35d97b8..0aa3c5ddd2 100644 --- a/geometry.cpp +++ b/geometry.cpp @@ -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); diff --git a/placement.cpp b/placement.cpp index 7eab74c943..ea2dc0d6ab 100644 --- a/placement.cpp +++ b/placement.cpp @@ -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 ); diff --git a/utils.h b/utils.h index b8faa45efa..ee172287fb 100644 --- a/utils.h +++ b/utils.h @@ -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)