Index: uspace/lib/display/test/display.c
===================================================================
--- uspace/lib/display/test/display.c	(revision 4ac11fff5b1d1159c3e41e2d439af21bf785bdfe)
+++ uspace/lib/display/test/display.c	(revision 2e6394e9b57983df5807f35868516f9bf997dc35)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2019 Jiri Svoboda
+ * Copyright (c) 2021 Jiri Svoboda
  * All rights reserved.
  *
@@ -59,4 +59,5 @@
 static errno_t test_window_move_req(void *, sysarg_t, gfx_coord2_t *);
 static errno_t test_window_move(void *, sysarg_t, gfx_coord2_t *);
+static errno_t test_window_get_pos(void *, sysarg_t, gfx_coord2_t *);
 static errno_t test_window_resize_req(void *, sysarg_t, display_wnd_rsztype_t,
     gfx_coord2_t *);
@@ -74,4 +75,5 @@
 	.window_move_req = test_window_move_req,
 	.window_move = test_window_move,
+	.window_get_pos = test_window_get_pos,
 	.window_resize_req = test_window_resize_req,
 	.window_resize = test_window_resize,
@@ -115,4 +117,8 @@
 	sysarg_t move_wnd_id;
 	gfx_coord2_t move_dpos;
+
+	bool window_get_pos_called;
+	sysarg_t get_pos_wnd_id;
+	gfx_coord2_t get_pos_rpos;
 
 	bool window_resize_req_called;
@@ -556,4 +562,116 @@
 }
 
+/** display_window_get_pos() with server returning error response works. */
+PCUT_TEST(window_get_pos_failure)
+{
+	errno_t rc;
+	service_id_t sid;
+	display_t *disp = NULL;
+	display_wnd_params_t params;
+	display_window_t *wnd;
+	gfx_coord2_t dpos;
+	test_response_t resp;
+
+	async_set_fallback_port_handler(test_display_conn, &resp);
+
+	// FIXME This causes this test to be non-reentrant!
+	rc = loc_server_register(test_display_server);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = loc_service_register(test_display_svc, &sid);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = display_open(test_display_svc, &disp);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+	PCUT_ASSERT_NOT_NULL(disp);
+
+	resp.rc = EOK;
+	display_wnd_params_init(&params);
+	params.rect.p0.x = 0;
+	params.rect.p0.y = 0;
+	params.rect.p0.x = 100;
+	params.rect.p0.y = 100;
+
+	rc = display_window_create(disp, &params, &test_display_wnd_cb,
+	    (void *) &resp, &wnd);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+	PCUT_ASSERT_NOT_NULL(wnd);
+
+	resp.rc = EIO;
+	resp.window_get_pos_called = false;
+
+	dpos.x = 0;
+	dpos.y = 0;
+
+	rc = display_window_get_pos(wnd, &dpos);
+	PCUT_ASSERT_TRUE(resp.window_get_pos_called);
+	PCUT_ASSERT_ERRNO_VAL(resp.rc, rc);
+	PCUT_ASSERT_INT_EQUALS(wnd->id, resp.get_pos_wnd_id);
+	PCUT_ASSERT_INT_EQUALS(0, dpos.x);
+	PCUT_ASSERT_INT_EQUALS(0, dpos.y);
+
+	display_window_destroy(wnd);
+	display_close(disp);
+	rc = loc_service_unregister(sid);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+}
+
+/** display_window_get_pos() with server returning success response works. */
+PCUT_TEST(window_get_pos_success)
+{
+	errno_t rc;
+	service_id_t sid;
+	display_t *disp = NULL;
+	display_wnd_params_t params;
+	display_window_t *wnd;
+	gfx_coord2_t dpos;
+	test_response_t resp;
+
+	async_set_fallback_port_handler(test_display_conn, &resp);
+
+	// FIXME This causes this test to be non-reentrant!
+	rc = loc_server_register(test_display_server);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = loc_service_register(test_display_svc, &sid);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = display_open(test_display_svc, &disp);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+	PCUT_ASSERT_NOT_NULL(disp);
+
+	resp.rc = EOK;
+	display_wnd_params_init(&params);
+	params.rect.p0.x = 0;
+	params.rect.p0.y = 0;
+	params.rect.p0.x = 100;
+	params.rect.p0.y = 100;
+
+	rc = display_window_create(disp, &params, &test_display_wnd_cb,
+	    (void *) &resp, &wnd);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+	PCUT_ASSERT_NOT_NULL(wnd);
+
+	resp.rc = EOK;
+	resp.window_get_pos_called = false;
+	resp.get_pos_rpos.x = 11;
+	resp.get_pos_rpos.y = 12;
+
+	dpos.x = 0;
+	dpos.y = 0;
+
+	rc = display_window_get_pos(wnd, &dpos);
+	PCUT_ASSERT_TRUE(resp.window_get_pos_called);
+	PCUT_ASSERT_ERRNO_VAL(resp.rc, rc);
+	PCUT_ASSERT_INT_EQUALS(wnd->id, resp.get_pos_wnd_id);
+	PCUT_ASSERT_INT_EQUALS(resp.get_pos_rpos.x, dpos.x);
+	PCUT_ASSERT_INT_EQUALS(resp.get_pos_rpos.y, dpos.y);
+
+	display_window_destroy(wnd);
+	display_close(disp);
+	rc = loc_service_unregister(sid);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+}
+
 /** display_window_resize_req() with server returning error response works. */
 PCUT_TEST(window_resize_req_failure)
@@ -937,6 +1055,5 @@
 	resp.rc = ENOMEM;
 	rc = display_window_get_gc(wnd, &gc);
-	/* async_connect_me_to() does not return specific error */
-	PCUT_ASSERT_ERRNO_VAL(EIO, rc);
+	PCUT_ASSERT_ERRNO_VAL(resp.rc, rc);
 	PCUT_ASSERT_NULL(gc);
 
@@ -1589,4 +1706,17 @@
 }
 
+static errno_t test_window_get_pos(void *arg, sysarg_t wnd_id, gfx_coord2_t *dpos)
+{
+	test_response_t *resp = (test_response_t *) arg;
+
+	resp->window_get_pos_called = true;
+	resp->get_pos_wnd_id = wnd_id;
+
+	if (resp->rc == EOK)
+		*dpos = resp->get_pos_rpos;
+
+	return resp->rc;
+}
+
 static errno_t test_window_resize_req(void *arg, sysarg_t wnd_id,
     display_wnd_rsztype_t rsztype, gfx_coord2_t *pos)
