Sophie

Sophie

distrib > Mandriva > 2009.0 > i586 > by-pkgid > d18d88a137ccea2f0522e89790d33970 > files > 8

compiz-0.7.8-2mdv2009.0.src.rpm

From 58ff533fd9fa8535f456072d5cb8e3512c9dc221 Mon Sep 17 00:00:00 2001
From: Danny Baumann <dannybaumann@web.de>
Date: Mon, 29 Sep 2008 17:58:11 +0200
Subject: [PATCH] Make sure window decorations aren't hidden under panels during placement.

---
 plugins/place.c |   18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/plugins/place.c b/plugins/place.c
index 596a3a5..fe4c39e 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
-- 
1.6.0.2