summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2008-09-29 17:58:11 +0200
committerDanny Baumann <dannybaumann@web.de>2008-09-29 17:58:11 +0200
commit3dd149ce5c465cf9b068aeb0bfdeb207907a836c (patch)
tree596b7dee8857c3c8093a7bf346b8c22e3012a059 /plugins
parent5a9efaf6a44de5e4189619ec93cedbab9b217bc9 (diff)
Make sure window decorations aren't hidden under panels during placement.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/place.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/plugins/place.c b/plugins/place.c
index 596a3a5c..fe4c39e9 100644
--- a/plugins/place.c
+++ b/plugins/place.c
@@ -1085,21 +1085,35 @@ placeConstrainToWorkarea (CompWindow *w,
int *y)
{
CompWindowExtents extents;
+ int width, height;
extents.left = *x - w->input.left;
extents.top = *y - w->input.top;
extents.right = *x + w->serverWidth + w->input.right;
extents.bottom = *y + w->serverHeight + w->input.bottom;
+ width = extents.right - extents.left;
+ height = extents.bottom - extents.top;
+
if (extents.left < workArea->x)
+ {
*x += workArea->x - extents.left;
- else if (extents.right > workArea->x + workArea->width)
+ }
+ else if (width <= workArea->width &&
+ extents.right > workArea->x + workArea->width)
+ {
*x += workArea->x + workArea->width - extents.right;
+ }
if (extents.top < workArea->y)
+ {
*y += workArea->y - extents.top;
- else if (extents.bottom > workArea->y + workArea->height)
+ }
+ else if (height <= workArea->height &&
+ extents.bottom > workArea->y + workArea->height)
+ {
*y += workArea->y + workArea->height - extents.bottom;
+ }
}
static Bool