diff --git a/include/core/rect.h b/include/core/rect.h
index 39e3d78..770544c 100644
--- a/include/core/rect.h
+++ b/include/core/rect.h
@@ -48,6 +48,11 @@ class CompRect {
 
 	void setGeometry (int, int, int, int);
 
+	void setX1 (int);
+	void setY1 (int);
+	void setX2 (int);
+	void setY2 (int);
+
 	bool operator== (const CompRect &) const;
 	bool operator!= (const CompRect &) const;
 
diff --git a/plugins/blur.cpp b/plugins/blur.cpp
index 2345dcf..f954510 100644
--- a/plugins/blur.cpp
+++ b/plugins/blur.cpp
@@ -168,7 +168,7 @@ regionFromBoxes (std::vector<BlurBox> boxes,
 			     &x2, &y2);
 
 	if (x2 > x1 && y2 > y1)
-	    region += CompRect (x1, x2, y1, y2);
+	    region += CompRect (x1, y1, x2, y2);
     }
 
     return region;
@@ -182,11 +182,11 @@ BlurWindow::updateRegion ()
     if (state[BLUR_STATE_DECOR].threshold)
     {
 	region += CompRect (-window->output ().left,
-			    window->width () + window->output ().right,
 			    -window->output ().top,
+			    window->width () + window->output ().right,
 			    window->height () + window->output ().bottom);
 
-	region -= CompRect (0, window->width (), 0, window->height ());
+	region -= CompRect (0, 0, window->width (), window->height ());
 
 	state[BLUR_STATE_DECOR].clipped = false;
 
@@ -1343,8 +1343,8 @@ BlurWindow::projectRegion (CompOutput     *output,
 
 	bScreen->tmpRegion3 +=
 	    CompRect (minX - bScreen->filterRadius,
-		      maxX + bScreen->filterRadius + 0.5f,
 		      screen->height () - maxY - bScreen->filterRadius,
+		      maxX + bScreen->filterRadius + 0.5f,
 		      screen->height () - minY + bScreen->filterRadius + 0.5f);
 	
     }
@@ -1370,9 +1370,9 @@ BlurWindow::updateDstTexture (const GLMatrix &transform,
 	    // top
 	    bScreen->tmpRegion2 = bScreen->tmpRegion.intersected (
 		CompRect (window->x () - window->output ().left,
+			  window->y () - window->output ().top,
 			  window->x () + window->width () +
 			  window->output ().right,
-			  window->y () - window->output ().top,
 			  window->y ()));
 
 	    if (!bScreen->tmpRegion2.isEmpty ())
@@ -1381,9 +1381,9 @@ BlurWindow::updateDstTexture (const GLMatrix &transform,
 	    // bottom
 	    bScreen->tmpRegion2 = bScreen->tmpRegion.intersected (
 		CompRect (window->x () - window->output ().left,
+			  window->y () + window->height (),
 			  window->x () + window->width () +
 			  window->output ().right,
-			  window->y () + window->height (),
 			  window->y () + window->height () +
 			  window->output ().bottom));
 
@@ -1393,8 +1393,8 @@ BlurWindow::updateDstTexture (const GLMatrix &transform,
 	    // left
 	    bScreen->tmpRegion2 = bScreen->tmpRegion.intersected (
 		CompRect (window->x () - window->output ().left,
-			  window->x (),
 			  window->y (),
+			  window->x (),
 			  window->y () + window->width ()));
 
 	    if (!bScreen->tmpRegion2.isEmpty ())
@@ -1403,9 +1403,9 @@ BlurWindow::updateDstTexture (const GLMatrix &transform,
 	    // right
 	    bScreen->tmpRegion2 = bScreen->tmpRegion.intersected (
 		CompRect (window->x () + window->width (),
+			  window->y (),
 			  window->x () + window->width () +
 			  window->output ().right,
-			  window->y (),
 			  window->y () + window->width ()));
 
 	    if (!bScreen->tmpRegion2.isEmpty ())
@@ -1417,8 +1417,8 @@ BlurWindow::updateDstTexture (const GLMatrix &transform,
 	    // center
 	    bScreen->tmpRegion2 = bScreen->tmpRegion.intersected (
 		CompRect (window->x (),
-			  window->x () + window->width (),
 			  window->y (),
+			  window->x () + window->width (),
 			  window->y () + window->width ()));
 
 	    if (!bScreen->tmpRegion2.isEmpty ())
@@ -1647,8 +1647,8 @@ BlurWindow::glDraw (const GLMatrix     &transform,
 	    if (!clientThreshold)
 	    {
 		bScreen->region -= CompRect (window->x (),
-					     window->x () + window->width (),
 					     window->y (),
+					     window->x () + window->width (),
 					     window->y () + window->height ());
 	    }
 
diff --git a/plugins/composite/screen.cpp b/plugins/composite/screen.cpp
index cc67ad4..96f944e 100644
--- a/plugins/composite/screen.cpp
+++ b/plugins/composite/screen.cpp
@@ -875,9 +875,11 @@ PrivateCompositeScreen::handleExposeEvent (XExposeEvent *event)
     if (output == event->window)
 	return;
 
-    exposeRects.push_back (CompRect (event->x, event->x + event->width,
-			   event->y, event->y + event->height));
-
+    exposeRects.push_back (CompRect (event->x,
+				     event->y,
+				     event->x + event->width,
+				     event->y + event->height));
+    
     if (event->count == 0)
     {
 	CompRect rect;
diff --git a/plugins/composite/window.cpp b/plugins/composite/window.cpp
index 871370a..07105ce 100644
--- a/plugins/composite/window.cpp
+++ b/plugins/composite/window.cpp
@@ -245,7 +245,7 @@ CompositeWindow::damageTransformedRect (float          xScale,
 	x2 += geom.x () + geom.border ();
 	y2 += geom.y () + geom.border ();
 
-	priv->cScreen->damageRegion (CompRegion (CompRect (x1, x2, y1, y2)));
+	priv->cScreen->damageRegion (CompRegion (CompRect (x1, y1, x2, y2)));
     }
 }
 
@@ -270,14 +270,14 @@ CompositeWindow::damageOutputExtents ()
 	y2 = -geom.border ();
 
 	if (x1 < x2 && y1 < y2)
-	    addDamageRect (CompRect (x1, x2, y1, y2));
+	    addDamageRect (CompRect (x1, y1, x2, y2));
 
 	/* bottom */
 	y1 = priv->window->size ().height () - geom.border ();
 	y2 = y1 + output.bottom - geom.border ();
 
 	if (x1 < x2 && y1 < y2)
-	    addDamageRect (CompRect (x1, x2, y1, y2));
+	    addDamageRect (CompRect (x1, y1, x2, y2));
 
 	/* left */
 	x1 = -output.left - geom.border ();
@@ -286,14 +286,14 @@ CompositeWindow::damageOutputExtents ()
 	y2 = priv->window->size ().height () - geom.border ();
 
 	if (x1 < x2 && y1 < y2)
-	    addDamageRect (CompRect (x1, x2, y1, y2));
+	    addDamageRect (CompRect (x1, y1, x2, y2));
 
 	/* right */
 	x1 = priv->window->size ().width () - geom.border ();
 	x2 = x1 + output.right - geom.border ();
 
 	if (x1 < x2 && y1 < y2)
-	    addDamageRect (CompRect (x1, x2, y1, y2));
+	    addDamageRect (CompRect (x1, y1, x2, y2));
     }
 }
 
@@ -318,7 +318,7 @@ CompositeWindow::addDamageRect (const CompRect &rect)
 	x2 += geom.x () + geom.border ();
 	y2 += geom.y () + geom.border ();
 
-	priv->cScreen->damageRegion (CompRegion (CompRect (x1, x2, y1, y2)));
+	priv->cScreen->damageRegion (CompRegion (CompRect (x1, y1, x2, y2)));
     }
 }
 
@@ -335,11 +335,11 @@ CompositeWindow::addDamage (bool force)
 
 	CompRect r (-MAX (priv->window->output ().left,
 		          priv->window->input ().left) - border,
+	            -MAX (priv->window->output ().top,
+		          priv->window->input ().top) - border,
 		    priv->window->size ().width () +
 		    MAX (priv->window->output ().right,
 		         priv->window->input ().right),
-	            -MAX (priv->window->output ().top,
-		          priv->window->input ().top) - border,
 		    priv->window->size ().height () +
 		    MAX (priv->window->output ().bottom,
 		         priv->window->input ().bottom));
@@ -401,7 +401,7 @@ PrivateCompositeWindow::handleDamageRect (CompositeWindow *w,
     x2 = x + width;
     y2 = y + height;
 
-    if (!w->damageRect (initial, CompRect (x, x2, y, y2)))
+    if (!w->damageRect (initial, CompRect (x, y, x2, y2)))
     {
 	CompWindow::Geometry geom = w->priv->window->geometry ();
 
@@ -410,7 +410,7 @@ PrivateCompositeWindow::handleDamageRect (CompositeWindow *w,
 	x2 += geom.x () + geom.border ();
 	y2 += geom.y () + geom.border ();
 
-	w->priv->cScreen->damageRegion (CompRegion (CompRect (x, x2, y, y2)));
+	w->priv->cScreen->damageRegion (CompRegion (CompRect (x, y, x2, y2)));
     }
 
     if (initial)
@@ -569,7 +569,7 @@ PrivateCompositeWindow::resizeNotify (int dx, int dy, int dwidth, int dheight)
 	y2 = y + window->size ().height () +
 	     window->output ().bottom - dy - dheight;
 
-	cScreen->damageRegion (CompRegion (CompRect (x1, x2, y1, y2)));
+	cScreen->damageRegion (CompRegion (CompRect (x1, y1, x2, y2)));
     }
 
     if (window->mapNum () && redirected)
@@ -614,7 +614,7 @@ PrivateCompositeWindow::moveNotify (int dx, int dy, bool now)
 	y2 = y + window->size ().height () +
 	     window->output ().bottom - dy;
 
-	cScreen->damageRegion (CompRegion (CompRect (x1, x2, y1, y2)));
+	cScreen->damageRegion (CompRegion (CompRect (x1, y1, x2, y2)));
     }
     cWindow->addDamage ();
 
diff --git a/plugins/copytex.cpp b/plugins/copytex.cpp
index 8a7d9c3..3df1d02 100644
--- a/plugins/copytex.cpp
+++ b/plugins/copytex.cpp
@@ -72,8 +72,9 @@ CopyPixmap::CopyPixmap (Pixmap pixmap,
 	for (int y = 0, h = height; y < nHeight; y++, h -= maxTS)
 	    textures[y + (x * nHeight)] =
 		new CopyTexture (this, CompRect (x * maxTS,
-				 (x * maxTS) + MIN (w, maxTS),
-				 y * maxTS, (y * maxTS) +  MIN (h, maxTS)));
+						 y * maxTS,
+						 (x * maxTS) + MIN (w, maxTS),
+						 (y * maxTS) +  MIN (h, maxTS)));
 
 
     damage = XDamageCreate (screen->dpy (), pixmap, XDamageReportRawRectangles);
@@ -114,7 +115,7 @@ CopyTexture::CopyTexture (CopyPixmap *cp, CompRect dim) :
     }
 
     setData (target, matrix, false);
-    setGeometry (dim.x1 (), dim.x2 (), dim.y1 (), dim.y2 ());
+    setGeometry (dim.x1 (), dim.y1 (), dim.x2 (), dim.y2 ());
 
     glBindTexture (target, name ());
 
@@ -249,7 +250,7 @@ CopytexScreen::handleEvent (XEvent *event)
 		}
 		
 		if (x1 < x2 && y1 < y2)
-		    t->damage.setGeometry (x1, x2, y1, y2);
+		    t->damage.setGeometry (x1, y1, x2, y2);
 
 	    }
 	}
diff --git a/plugins/decor.cpp b/plugins/decor.cpp
index 6ccf98d..2f1e9a1 100644
--- a/plugins/decor.cpp
+++ b/plugins/decor.cpp
@@ -66,8 +66,8 @@ DecorWindow::glDraw (const GLMatrix     &transform,
 
 	for (int i = 0; i < wd->nQuad; i++)
 	{
-	    box.setGeometry (wd->quad[i].box.x1, wd->quad[i].box.x2,
-			     wd->quad[i].box.y1, wd->quad[i].box.y2);
+	    box.setGeometry (wd->quad[i].box.x1, wd->quad[i].box.y1,
+			     wd->quad[i].box.x2, wd->quad[i].box.y2);
 
 	    if (box.x1 () < box.x2 () &&
 		box.y1 () < box.y2 ())
diff --git a/plugins/opengl/texture.cpp b/plugins/opengl/texture.cpp
index d335084..aadaa9d 100644
--- a/plugins/opengl/texture.cpp
+++ b/plugins/opengl/texture.cpp
@@ -318,7 +318,7 @@ PrivateTexture::loadImageData (const char   *image,
     }
 
     t->setData (target, matrix, mipmap);
-    t->setGeometry (0, width, 0, height);
+    t->setGeometry (0, 0, width, height);
 
     glBindTexture (target, t->name ());
 
@@ -559,7 +559,7 @@ TfpTexture::bindPixmapToTexture (Pixmap pixmap,
 
     tex = new TfpTexture ();
     tex->setData (texTarget, matrix, mipmap);
-    tex->setGeometry (0, width, 0, height);
+    tex->setGeometry (0,0, width, height);
     tex->pixmap = glxPixmap;
 
     rv[0] = tex;
diff --git a/plugins/resize.cpp b/plugins/resize.cpp
index 76817fb..676377c 100644
--- a/plugins/resize.cpp
+++ b/plugins/resize.cpp
@@ -98,7 +98,7 @@ ResizeScreen::damageRectangle (BoxPtr pBox)
     y2 = pBox->y2 + 1;
 
     if (cScreen)
-	cScreen->damageRegion (CompRegion (CompRect (x1, x2, y1, y2)));
+	cScreen->damageRegion (CompRegion (CompRect (x1, y1, x2, y2)));
 }
 
 Cursor
diff --git a/src/output.cpp b/src/output.cpp
index 5fda864..13da8d0 100644
--- a/src/output.cpp
+++ b/src/output.cpp
@@ -82,7 +82,7 @@ CompOutput::setWorkArea (XRectangle workarea)
 
 }
 void
-CompOutput::setGeometry (int x1, int x2, int y1, int y2)
+CompOutput::setGeometry (int x1, int y1, int x2, int y2)
 {
     if (x1 < 0)
 	x1 = 0;
@@ -96,7 +96,7 @@ CompOutput::setGeometry (int x1, int x2, int y1, int y2)
     if (y2 < 0)
 	y2 = 0;
 
-    CompRect::setGeometry (x1, x2, y1, y2);
+    CompRect::setGeometry (x1, y1, x2, y2);
 
     mWorkArea.x      = this->x1 ();
     mWorkArea.y      = this->y1 ();
diff --git a/src/rect.cpp b/src/rect.cpp
index 38ea292..7252159 100644
--- a/src/rect.cpp
+++ b/src/rect.cpp
@@ -36,13 +36,13 @@ CompRect::CompRect ()
     mRegion.extents.y2 = 0;
 }
 
-CompRect::CompRect (int x1, int x2, int y1, int y2)
+CompRect::CompRect (int x1, int y1, int x2, int y2)
 {
     mRegion.rects = &mRegion.extents;
     mRegion.numRects = 1;
     mRegion.extents.x1 = x1;
-    mRegion.extents.x2 = x2;
     mRegion.extents.y1 = y1;
+    mRegion.extents.x2 = x2;
     mRegion.extents.y2 = y2;
 }
 
@@ -69,7 +69,7 @@ CompRect::region () const
 }
 
 void
-CompRect::setGeometry (int x1, int x2, int y1, int y2)
+CompRect::setGeometry (int x1, int y1, int x2, int y2)
 {
     mRegion.extents.x1 = x1;
     mRegion.extents.y1 = y1;
@@ -85,6 +85,35 @@ CompRect::setGeometry (int x1, int x2, int y1, int y2)
 	mRegion.extents.y2 = y2;
 }
 
+void
+CompRect::setX1 (int x1)
+{
+    mRegion.extents.x1 = x1;
+}
+
+void
+CompRect::setY1 (int y1)
+{
+    mRegion.extents.y1 = y1;
+}
+
+void
+CompRect::setX2 (int x2)
+{
+    if (x2 < mRegion.extents.x1)
+	mRegion.extents.x2 = mRegion.extents.x1;
+    else
+	mRegion.extents.x2 = x2;
+}
+
+void
+CompRect::setY2 (int y2)
+{
+    if (y2 < mRegion.extents.y1)
+	mRegion.extents.y2 = mRegion.extents.y1;
+    else
+	mRegion.extents.y2 = y2;
+}
 bool
 CompRect::operator== (const CompRect &rect) const
 {
diff --git a/src/region.cpp b/src/region.cpp
index b3f6de8..d04c092 100644
--- a/src/region.cpp
+++ b/src/region.cpp
@@ -33,8 +33,8 @@
 
 #include "privateregion.h"
 
-const CompRegion infiniteRegion (CompRect (MINSHORT, MAXSHORT,
-				           MINSHORT, MAXSHORT));
+const CompRegion infiniteRegion (CompRect (MINSHORT, MINSHORT,
+				           MAXSHORT, MAXSHORT));
 const CompRegion emptyRegion;
 
 CompRegion::CompRegion ()
@@ -58,7 +58,7 @@ CompRegion::CompRegion (const CompRegion &c)
 CompRegion::CompRegion ( int x, int y, int w, int h)
 {
     priv = new PrivateRegion ();
-    priv->box.extents = CompRect (x, x + w, y, y + h).region ()->extents;
+    priv->box.extents = CompRect (x,y, x + w, y + h).region ()->extents;
     priv->box.numRects = 1;
     priv->box.rects = &priv->box.extents;
 }
@@ -121,7 +121,7 @@ CompRect
 CompRegion::boundingRect () const
 {
     BOX b = handle ()->extents;
-    return CompRect (b.x1, b.x2, b.y1, b.y2);
+    return CompRect (b.x1, b.y1, b.x2, b.y2);
 }
 
 bool
@@ -187,8 +187,8 @@ CompRegion::rects () const
 	return rv;
     if (!priv->region)
     {
-	rv.push_back (CompRect (priv->box.extents.x1, priv->box.extents.x2,
-		                priv->box.extents.y1, priv->box.extents.y2));
+	rv.push_back (CompRect (priv->box.extents.x1, priv->box.extents.y1,
+		                priv->box.extents.x2, priv->box.extents.y2));
 	return rv;
     }
 
@@ -196,7 +196,7 @@ CompRegion::rects () const
     for (int i = 0; i < priv->region->numRects; i++)
     {
 	b = priv->region->rects[i];
-	rv.push_back (CompRect (b.x1, b.x2, b.y1, b.y2));
+	rv.push_back (CompRect (b.x1, b.y1, b.x2, b.y2));
     }
     return rv;
 }
diff --git a/src/screen.cpp b/src/screen.cpp
index 642cf10..5c84f65 100644
--- a/src/screen.cpp
+++ b/src/screen.cpp
@@ -2036,7 +2036,7 @@ PrivateScreen::updateOutputDevices ()
 	    if (outputDevs.size () < nOutput + 1)
 		outputDevs.resize (nOutput + 1);
 
-	    outputDevs[nOutput].setGeometry (x1, x2, y1, y2);
+	    outputDevs[nOutput].setGeometry (x1, y1, x2, y2);
 	    nOutput++;
 	}
     }
@@ -2047,7 +2047,7 @@ PrivateScreen::updateOutputDevices ()
 	if (outputDevs.size () < 1)
 	    outputDevs.resize (1);
 
-	outputDevs[0].setGeometry (0, screen->width (), 0, screen->height ());
+	outputDevs[0].setGeometry (0, 0, screen->width (), screen->height ());
 	nOutput = 1;
     }
 
diff --git a/src/window.cpp b/src/window.cpp
index 83bb4fa..5db564a 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -803,7 +803,7 @@ PrivateWindow::updateRegion ()
 	    x2 += priv->attrib.x;
 	    y2 += priv->attrib.y;
 
-	    priv->region += CompRect (x1, x2, y1, y2);
+	    priv->region += CompRect (x1, y1, x2, y2);
 	}
     }
 
@@ -4908,8 +4908,8 @@ CompWindow::updateFrameRegion ()
 	r = priv->region.boundingRect ();
 	priv->frameRegion -= r;
 
-	r.setGeometry (r.x1 () - priv->input.left, r.x2 () + priv->input.right,
-		       r.y1 () - priv->input.top, r.y2 () + priv->input.bottom);
+	r.setGeometry (r.x1 () - priv->input.left, r.y1 () - priv->input.top, 
+		       r.x2 () + priv->input.right, r.y2 () + priv->input.bottom);
 
 	priv->frameRegion &= CompRegion (r);
 
