Index: uspace/drv/fb/kfb/port.c
===================================================================
--- uspace/drv/fb/kfb/port.c	(revision 65160d7b5c9319574b34becfbfbd0921c9a0b187)
+++ uspace/drv/fb/kfb/port.c	(revision c2250702b9691485c237b9d3dce30775a4798af8)
@@ -68,6 +68,5 @@
 
 	sysarg_t paddr;
-	sysarg_t width;
-	sysarg_t height;
+	gfx_rect_t rect;
 	size_t offset;
 	size_t scanline;
@@ -154,10 +153,12 @@
 {
 	kfb_t *kfb = (kfb_t *) arg;
+	gfx_rect_t crect;
 	gfx_coord_t x, y;
 
-	// XXX We should handle p0.x > p1.x and p0.y > p1.y
-
-	for (y = rect->p0.y; y < rect->p1.y; y++) {
-		for (x = rect->p0.x; x < rect->p1.x; x++) {
+	/* Make sure we have a sorted, clipped rectangle */
+	gfx_rect_clip(rect, &kfb->rect, &crect);
+
+	for (y = crect.p0.y; y < crect.p1.y; y++) {
+		for (x = crect.p0.x; x < crect.p1.x; x++) {
 			kfb->pixel2visual(kfb->addr + FB_POS(kfb, x, y),
 			    kfb->color);
@@ -242,4 +243,6 @@
 	gfx_rect_t srect;
 	gfx_rect_t drect;
+	gfx_rect_t skfbrect;
+	gfx_rect_t crect;
 	gfx_coord2_t offs;
 	gfx_coord2_t bmdim;
@@ -251,6 +254,8 @@
 	pixel_t color;
 
+	/* Clip source rectangle to bitmap bounds */
+
 	if (srect0 != NULL)
-		srect = *srect0;
+		gfx_rect_clip(srect0, &kfbbm->rect, &srect);
 	else
 		srect = kfbbm->rect;
@@ -272,6 +277,15 @@
 	pbm.data = kfbbm->alloc.pixels;
 
-	for (pos.y = srect.p0.y; pos.y < srect.p1.y; pos.y++) {
-		for (pos.x = srect.p0.x; pos.x < srect.p1.x; pos.x++) {
+	/* Transform KFB bounding rectangle back to bitmap coordinate system */
+	gfx_rect_rtranslate(&offs, &kfb->rect, &skfbrect);
+
+	/*
+	 * Make sure we have a sorted source rectangle, clipped so that
+	 * destination lies within KFB bounding rectangle
+	 */
+	gfx_rect_clip(&srect, &skfbrect, &crect);
+
+	for (pos.y = crect.p0.y; pos.y < crect.p1.y; pos.y++) {
+		for (pos.x = crect.p0.x; pos.x < crect.p1.x; pos.x++) {
 			gfx_coord2_subtract(&pos, &kfbbm->rect.p0, &sp);
 			gfx_coord2_add(&pos, &offs, &dp);
@@ -429,6 +443,9 @@
 	kfb->fun = fun;
 
-	kfb->width = width;
-	kfb->height = height;
+	kfb->rect.p0.x = 0;
+	kfb->rect.p0.y = 0;
+	kfb->rect.p1.x = width;
+	kfb->rect.p1.y = height;
+
 	kfb->paddr = paddr;
 	kfb->offset = offset;
Index: uspace/lib/gfx/src/coord.c
===================================================================
--- uspace/lib/gfx/src/coord.c	(revision 65160d7b5c9319574b34becfbfbd0921c9a0b187)
+++ uspace/lib/gfx/src/coord.c	(revision c2250702b9691485c237b9d3dce30775a4798af8)
@@ -145,5 +145,6 @@
  *
  * If the two rectangles do not intersect, the result will be an empty
- * rectangle (check with gfx_rect_is_empty()).
+ * rectangle (check with gfx_rect_is_empty()). The resulting rectangle
+ * is always sorted.
  *
  * @param rect Source rectangle
Index: uspace/srv/hid/display/seat.c
===================================================================
--- uspace/srv/hid/display/seat.c	(revision 65160d7b5c9319574b34becfbfbd0921c9a0b187)
+++ uspace/srv/hid/display/seat.c	(revision c2250702b9691485c237b9d3dce30775a4798af8)
@@ -59,6 +59,6 @@
 
 	ds_display_add_seat(display, seat);
-	seat->pntpos.x = 10;
-	seat->pntpos.y = 10;
+	seat->pntpos.x = 0;
+	seat->pntpos.y = 0;
 
 	*rseat = seat;
@@ -242,12 +242,12 @@
 		printf("PTD_MOVE\n");
 		gfx_coord2_add(&seat->pntpos, &event->dmove, &npos);
-		if (npos.x < 10)
-			npos.x = 10;
-		if (npos.y < 10)
-			npos.y = 10;
-		if (npos.x > 1024 - 10)
-			npos.x = 1024 - 10;
-		if (npos.y > 768 - 10)
-			npos.y = 768 - 10;
+		if (npos.x < 0)
+			npos.x = 0;
+		if (npos.y < 0)
+			npos.y = 0;
+		if (npos.x > 1024)
+			npos.x = 1024;
+		if (npos.y > 768)
+			npos.y = 768;
 
 		printf("clear pointer\n");
