Index: uspace/srv/hid/display/test/window.c
===================================================================
--- uspace/srv/hid/display/test/window.c	(revision 34342334f4ef070d93f0cc4c5270e49e76ef9e7e)
+++ uspace/srv/hid/display/test/window.c	(revision 2012fe01183718ce4b9d44a0227c8401a0a15ae3)
@@ -29,4 +29,5 @@
 #include <disp_srv.h>
 #include <errno.h>
+#include <gfx/context.h>
 #include <pcut/pcut.h>
 #include <stdio.h>
@@ -40,4 +41,12 @@
 
 PCUT_TEST_SUITE(window);
+
+static errno_t dummy_set_color(void *, gfx_color_t *);
+static errno_t dummy_fill_rect(void *, gfx_rect_t *);
+
+static gfx_context_ops_t dummy_ops = {
+	.set_color = dummy_set_color,
+	.fill_rect = dummy_fill_rect
+};
 
 /** Test ds_window_get_ctx(). */
@@ -72,3 +81,76 @@
 }
 
+/** Test ds_window_post_pos_event() */
+PCUT_TEST(window_post_pos_event)
+{
+	gfx_context_t *gc;
+	ds_display_t *disp;
+	ds_client_t *client;
+	ds_window_t *wnd;
+	display_wnd_params_t params;
+	pos_event_t event;
+	errno_t rc;
+
+	rc = gfx_context_new(&dummy_ops, NULL, &gc);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = ds_display_create(gc, &disp);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = ds_client_create(disp, NULL, NULL, &client);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	display_wnd_params_init(&params);
+	params.rect.p0.x = params.rect.p0.y = 0;
+	params.rect.p1.x = params.rect.p1.y = 1;
+
+	rc = ds_window_create(client, &params, &wnd);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	PCUT_ASSERT_INT_EQUALS(dsw_idle, wnd->state);
+
+	event.type = POS_PRESS;
+	event.hpos = 10;
+	event.vpos = 10;
+	rc = ds_window_post_pos_event(wnd, &event);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	PCUT_ASSERT_INT_EQUALS(dsw_moving, wnd->state);
+
+	event.type = POS_UPDATE;
+	event.hpos = 11;
+	event.vpos = 12;
+	rc = ds_window_post_pos_event(wnd, &event);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	PCUT_ASSERT_INT_EQUALS(dsw_moving, wnd->state);
+	PCUT_ASSERT_INT_EQUALS(wnd->dpos.x, 0);
+	PCUT_ASSERT_INT_EQUALS(wnd->dpos.y, 0);
+
+	event.type = POS_RELEASE;
+	event.hpos = 13;
+	event.vpos = 14;
+
+	rc = ds_window_post_pos_event(wnd, &event);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	PCUT_ASSERT_INT_EQUALS(dsw_idle, wnd->state);
+	PCUT_ASSERT_INT_EQUALS(wnd->dpos.x, 3);
+	PCUT_ASSERT_INT_EQUALS(wnd->dpos.y, 4);
+
+	ds_window_destroy(wnd);
+	ds_client_destroy(client);
+	ds_display_destroy(disp);
+}
+
+static errno_t dummy_set_color(void *arg, gfx_color_t *color)
+{
+	return EOK;
+}
+
+static errno_t dummy_fill_rect(void *arg, gfx_rect_t *rect)
+{
+	return EOK;
+}
+
 PCUT_EXPORT(window);
