Index: uspace/lib/congfx/src/console.c
===================================================================
--- uspace/lib/congfx/src/console.c	(revision 7b882c1fb956e7997643c445ef2c7aed9e2891ff)
+++ uspace/lib/congfx/src/console.c	(revision 6301a24fb081993e0e1d27b0a61a9bab72fca055)
@@ -129,4 +129,6 @@
 	console_gc_t *cgc = NULL;
 	gfx_context_t *gc = NULL;
+	sysarg_t rows;
+	sysarg_t cols;
 	errno_t rc;
 
@@ -137,4 +139,8 @@
 	}
 
+	rc = console_get_size(con, &cols, &rows);
+	if (rc != EOK)
+		goto error;
+
 	rc = gfx_context_new(&console_gc_ops, cgc, &gc);
 	if (rc != EOK)
@@ -144,4 +150,9 @@
 	cgc->con = con;
 	cgc->fout = fout;
+	cgc->rect.p0.x = 0;
+	cgc->rect.p0.y = 0;
+	cgc->rect.p1.x = cols;
+	cgc->rect.p1.y = rows - 1; /* make sure we avoid bottom-right corner */
+
 	*rgc = cgc;
 	return EOK;
@@ -201,4 +212,6 @@
 	gfx_coord2_subtract(&params->rect.p1, &params->rect.p0, &dim);
 	cbm->rect = params->rect;
+	cbm->flags = params->flags;
+	cbm->key_color = params->key_color;
 
 	if (alloc == NULL) {
@@ -256,4 +269,5 @@
 	gfx_rect_t srect;
 	gfx_rect_t drect;
+	gfx_rect_t crect;
 	gfx_coord2_t offs;
 
@@ -270,6 +284,6 @@
 	}
 
-	// XXX Add function to translate rectangle
 	gfx_rect_translate(&offs, &srect, &drect);
+	gfx_rect_clip(&drect, &cbm->cgc->rect, &crect);
 
 	pixelmap.width = cbm->rect.p1.x - cbm->rect.p0.x;
@@ -277,18 +291,40 @@
 	pixelmap.data = cbm->alloc.pixels;
 
-	for (y = drect.p0.y; y < drect.p1.y; y++) {
-		console_set_pos(cbm->cgc->con, drect.p0.x, y);
-
-		for (x = drect.p0.x; x < drect.p1.x; x++) {
-			clr = pixelmap_get_pixel(&pixelmap,
-			    x - offs.x - cbm->rect.p0.x,
-			    y - offs.y - cbm->rect.p0.y);
-			console_set_rgb_color(cbm->cgc->con, clr, clr);
-
-			rv = fputc('X', cbm->cgc->fout);
-			if (rv < 0)
-				return EIO;
-
-			console_flush(cbm->cgc->con);
+	if ((cbm->flags & bmpf_color_key) == 0) {
+		for (y = crect.p0.y; y < crect.p1.y; y++) {
+			console_set_pos(cbm->cgc->con, crect.p0.x, y);
+
+			for (x = crect.p0.x; x < crect.p1.x; x++) {
+				clr = pixelmap_get_pixel(&pixelmap,
+				    x - offs.x - cbm->rect.p0.x,
+				    y - offs.y - cbm->rect.p0.y);
+				console_set_rgb_color(cbm->cgc->con, clr, clr);
+
+				rv = fputc('X', cbm->cgc->fout);
+				if (rv < 0)
+					return EIO;
+
+				console_flush(cbm->cgc->con);
+			}
+		}
+	} else {
+		for (y = crect.p0.y; y < crect.p1.y; y++) {
+			for (x = crect.p0.x; x < crect.p1.x; x++) {
+
+				clr = pixelmap_get_pixel(&pixelmap,
+				    x - offs.x - cbm->rect.p0.x,
+				    y - offs.y - cbm->rect.p0.y);
+				console_set_rgb_color(cbm->cgc->con, clr, clr);
+
+				if (clr != cbm->key_color) {
+					console_set_pos(cbm->cgc->con, x, y);
+					rv = fputc('X', cbm->cgc->fout);
+					if (rv < 0)
+						return EIO;
+
+					console_flush(cbm->cgc->con);
+				}
+
+			}
 		}
 	}
