Index: uspace/srv/hid/display/ddev.c
===================================================================
--- uspace/srv/hid/display/ddev.c	(revision f7fb2b21131809c1562e26f51bdbd58de9f0fff3)
+++ uspace/srv/hid/display/ddev.c	(revision e1f2079eea6e0ce553d66ced5b7ca0b64e0b4929)
@@ -37,4 +37,5 @@
 #include <ddev.h>
 #include <errno.h>
+#include <io/log.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -53,4 +54,5 @@
 {
 	ds_ddev_t *ddev;
+	ddev_info_t info;
 	gfx_context_t *gc;
 	ddev_t *dd = NULL;
@@ -71,4 +73,17 @@
 		return rc;
 	}
+
+	rc = ddev_get_info(dd, &info);
+	if (rc != EOK) {
+		printf("Error getting information for display device '%s'.\n",
+		    name);
+		free(name);
+		ddev_close(dd);
+		return rc;
+	}
+
+	log_msg(LOG_DEFAULT, LVL_NOTE, "Device rectangle for '%s': "
+	    "%d,%d,%d,%d\n", name, info.rect.p0.x, info.rect.p0.y,
+	    info.rect.p1.x, info.rect.p1.y);
 
 	rc = ddev_get_gc(dd, &gc);
@@ -91,4 +106,5 @@
 	ddev->dd = dd;
 	ddev->gc = gc;
+	ddev->info = info;
 
 	ds_display_add_ddev(display, ddev);
Index: uspace/srv/hid/display/display.c
===================================================================
--- uspace/srv/hid/display/display.c	(revision f7fb2b21131809c1562e26f51bdbd58de9f0fff3)
+++ uspace/srv/hid/display/display.c	(revision e1f2079eea6e0ce553d66ced5b7ca0b64e0b4929)
@@ -384,4 +384,8 @@
 	assert(!link_used(&ddev->lddevs));
 
+	/* Set display dimensions to dimensions of first display device */
+	if (gfx_rect_is_empty(&disp->rect))
+		disp->rect = ddev->info.rect;
+
 	ddev->display = disp;
 	list_append(&ddev->lddevs, &disp->ddevs);
@@ -447,18 +451,12 @@
 errno_t ds_display_paint_bg(ds_display_t *disp, gfx_rect_t *rect)
 {
-	gfx_rect_t dsrect;
 	gfx_rect_t crect;
 	gfx_context_t *gc;
 	errno_t rc;
 
-	dsrect.p0.x = 0;
-	dsrect.p0.y = 0;
-	dsrect.p1.x = 1024;
-	dsrect.p1.y = 768;
-
 	if (rect != NULL)
-		gfx_rect_clip(&dsrect, rect, &crect);
+		gfx_rect_clip(&disp->rect, rect, &crect);
 	else
-		crect = dsrect;
+		crect = disp->rect;
 
 	gc = ds_display_get_gc(disp); // XXX
Index: uspace/srv/hid/display/seat.c
===================================================================
--- uspace/srv/hid/display/seat.c	(revision f7fb2b21131809c1562e26f51bdbd58de9f0fff3)
+++ uspace/srv/hid/display/seat.c	(revision e1f2079eea6e0ce553d66ced5b7ca0b64e0b4929)
@@ -253,4 +253,5 @@
 errno_t ds_seat_post_ptd_event(ds_seat_t *seat, ptd_event_t *event)
 {
+	ds_display_t *disp = seat->display;
 	gfx_coord2_t npos;
 	ds_window_t *wnd;
@@ -287,12 +288,5 @@
 
 		gfx_coord2_add(&seat->pntpos, &event->dmove, &npos);
-		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;
+		gfx_coord2_clip(&npos, &disp->rect, &npos);
 
 		printf("clear pointer\n");
Index: uspace/srv/hid/display/types/display/ddev.h
===================================================================
--- uspace/srv/hid/display/types/display/ddev.h	(revision f7fb2b21131809c1562e26f51bdbd58de9f0fff3)
+++ uspace/srv/hid/display/types/display/ddev.h	(revision e1f2079eea6e0ce553d66ced5b7ca0b64e0b4929)
@@ -52,4 +52,6 @@
 	/** Device GC */
 	gfx_context_t *gc;
+	/** Display device information */
+	ddev_info_t info;
 	/** Service ID */
 	service_id_t svc_id;
Index: uspace/srv/hid/display/types/display/display.h
===================================================================
--- uspace/srv/hid/display/types/display/display.h	(revision f7fb2b21131809c1562e26f51bdbd58de9f0fff3)
+++ uspace/srv/hid/display/types/display/display.h	(revision e1f2079eea6e0ce553d66ced5b7ca0b64e0b4929)
@@ -39,4 +39,5 @@
 #include <adt/list.h>
 #include <gfx/color.h>
+#include <gfx/coord.h>
 #include <io/input.h>
 #include "window.h"
@@ -69,4 +70,7 @@
 	/** Background color */
 	gfx_color_t *bg_color;
+
+	/** Bounding rectangle */
+	gfx_rect_t rect;
 } ds_display_t;
 
Index: uspace/srv/hid/rfb/main.c
===================================================================
--- uspace/srv/hid/rfb/main.c	(revision f7fb2b21131809c1562e26f51bdbd58de9f0fff3)
+++ uspace/srv/hid/rfb/main.c	(revision e1f2079eea6e0ce553d66ced5b7ca0b64e0b4929)
@@ -27,4 +27,5 @@
  */
 
+#include <ddev/info.h>
 #include <ddev_srv.h>
 #include <errno.h>
@@ -46,4 +47,7 @@
 #define NAME "rfb"
 
+static errno_t rfb_ddev_get_gc(void *, sysarg_t *, sysarg_t *);
+static errno_t rfb_ddev_get_info(void *, ddev_info_t *);
+
 static errno_t rfb_gc_set_color(void *, gfx_color_t *);
 static errno_t rfb_gc_fill_rect(void *, gfx_rect_t *);
@@ -55,4 +59,6 @@
 
 static ddev_ops_t rfb_ddev_ops = {
+	.get_gc = rfb_ddev_get_gc,
+	.get_info = rfb_ddev_get_info
 };
 
@@ -103,4 +109,25 @@
 	rfb->damage_rect.width = new_rect.p1.x - new_rect.p0.x;
 	rfb->damage_rect.height = new_rect.p1.y - new_rect.p1.y;
+}
+
+static errno_t rfb_ddev_get_gc(void *arg, sysarg_t *arg2, sysarg_t *arg3)
+{
+	*arg2 = 0;
+	*arg3 = 42;
+	return EOK;
+}
+
+static errno_t rfb_ddev_get_info(void *arg, ddev_info_t *info)
+{
+	rfb_t *rfb = (rfb_t *) arg;
+
+	ddev_info_init(info);
+
+	info->rect.p0.x = 0;
+	info->rect.p0.y = 0;
+	info->rect.p1.x = rfb->width;
+	info->rect.p1.y = rfb->height;
+
+	return EOK;
 }
 
@@ -284,4 +311,5 @@
 static void client_connection(ipc_call_t *icall, void *arg)
 {
+	rfb_t *rfb = (rfb_t *) arg;
 	ddev_srv_t srv;
 	sysarg_t svc_id;
@@ -295,10 +323,10 @@
 		ddev_srv_initialize(&srv);
 		srv.ops = &rfb_ddev_ops;
-		srv.arg = arg;
+		srv.arg = (void *) rfb;
 
 		/* Handle connection */
 		ddev_conn(icall, &srv);
 	} else {
-		rc = gfx_context_new(&rfb_gc_ops, arg, &gc);
+		rc = gfx_context_new(&rfb_gc_ops, (void *) rfb, &gc);
 		if (rc != EOK) {
 			async_answer_0(icall, ENOMEM);
