Index: uspace/app/gfxdemo/gfxdemo.c
===================================================================
--- uspace/app/gfxdemo/gfxdemo.c	(revision 66a2becf49f1f530dd13dbf6fc8236890fb7f907)
+++ uspace/app/gfxdemo/gfxdemo.c	(revision b93ec7c0b1ad687158c0b60742ae81046302f956)
@@ -33,10 +33,7 @@
  */
 
-#include <canvas.h>
 #include <congfx/console.h>
-#include <draw/surface.h>
 #include <display.h>
 #include <fibril.h>
-#include <guigfx/canvas.h>
 #include <gfx/bitmap.h>
 #include <gfx/color.h>
@@ -51,5 +48,7 @@
 #include <str.h>
 #include <task.h>
-#include <window.h>
+#include <ui/ui.h>
+#include <ui/window.h>
+#include <ui/wdecor.h>
 
 static void wnd_close_event(void *);
@@ -59,4 +58,12 @@
 	.close_event = wnd_close_event,
 	.kbd_event = wnd_kbd_event
+};
+
+static void uiwnd_close_event(ui_window_t *, void *);
+static void uiwnd_kbd_event(ui_window_t *, void *, kbd_event_t *);
+
+static ui_window_cb_t ui_window_cb = {
+	.close = uiwnd_close_event,
+	.kbd = uiwnd_kbd_event
 };
 
@@ -696,68 +703,70 @@
 }
 
-/** Run demo on canvas. */
-static errno_t demo_canvas(const char *display_svc)
-{
-	canvas_gc_t *cgc = NULL;
+/** Run demo on UI. */
+static errno_t demo_ui(const char *display_spec)
+{
+	ui_t *ui = NULL;
+	ui_wnd_params_t params;
+	ui_window_t *window = NULL;
 	gfx_context_t *gc;
-	window_t *window = NULL;
-	pixel_t *pixbuf = NULL;
-	surface_t *surface = NULL;
-	canvas_t *canvas = NULL;
-	gfx_coord_t vw, vh;
-	errno_t rc;
-
-	printf("Init canvas..\n");
-
-	window = window_open(display_svc, NULL,
-	    WINDOW_MAIN | WINDOW_DECORATED, "GFX Demo");
-	if (window == NULL) {
+	gfx_rect_t rect;
+	gfx_rect_t wrect;
+	gfx_coord2_t off;
+	errno_t rc;
+
+	printf("Init UI..\n");
+
+	rc = ui_create(display_spec, &ui);
+	if (rc != EOK) {
+		printf("Error initializing UI (%s)\n", display_spec);
+		goto error;
+	}
+
+	rect.p0.x = 0;
+	rect.p0.y = 0;
+	rect.p1.x = 400;
+	rect.p1.y = 300;
+
+	ui_wnd_params_init(&params);
+	params.caption = "GFX Demo";
+
+	/*
+	 * Compute window rectangle such that application area corresponds
+	 * to rect
+	 */
+	ui_wdecor_rect_from_app(&rect, &wrect);
+	off = wrect.p0;
+	gfx_rect_rtranslate(&off, &wrect, &params.rect);
+
+	rc = ui_window_create(ui, &params, &window);
+	if (rc != EOK) {
 		printf("Error creating window.\n");
-		return -1;
-	}
-
-	vw = 400;
-	vh = 300;
-
-	pixbuf = calloc(vw * vh, sizeof(pixel_t));
-	if (pixbuf == NULL) {
-		printf("Error allocating memory for pixel buffer.\n");
-		return ENOMEM;
-	}
-
-	surface = surface_create(vw, vh, pixbuf, 0);
-	if (surface == NULL) {
-		printf("Error creating surface.\n");
-		return EIO;
-	}
-
-	canvas = create_canvas(window_root(window), NULL, vw, vh,
-	    surface);
-	if (canvas == NULL) {
-		printf("Error creating canvas.\n");
-		return EIO;
-	}
-
-	window_resize(window, 0, 0, vw + 10, vh + 30, WINDOW_PLACEMENT_ANY);
-	window_exec(window);
-
-	printf("Create canvas GC\n");
-	rc = canvas_gc_create(canvas, surface, &cgc);
-	if (rc != EOK)
-		return rc;
-
-	gc = canvas_gc_get_ctx(cgc);
+		goto error;
+	}
+
+	ui_window_set_cb(window, &ui_window_cb, NULL);
+
+	rc = ui_window_get_app_gc(window, &gc);
+	if (rc != EOK) {
+		printf("Error creating graphic context.\n");
+		goto error;
+	}
 
 	task_retval(0);
 
-	rc = demo_loop(gc, 400, 300);
-	if (rc != EOK)
-		return rc;
-
-	rc = canvas_gc_delete(cgc);
-	if (rc != EOK)
-		return rc;
-
-	return EOK;
+	rc = demo_loop(gc, rect.p1.x, rect.p1.y);
+	if (rc != EOK)
+		goto error;
+
+	ui_window_destroy(window);
+	ui_destroy(ui);
+
+	return EOK;
+error:
+	if (window != NULL)
+		ui_window_destroy(window);
+	if (ui != NULL)
+		ui_destroy(ui);
+	return rc;
 }
 
@@ -820,4 +829,17 @@
 
 static void wnd_kbd_event(void *arg, kbd_event_t *event)
+{
+	printf("Keyboard event type=%d key=%d\n", event->type, event->key);
+	if (event->type == KEY_PRESS)
+		quit = true;
+}
+
+static void uiwnd_close_event(ui_window_t *window, void *arg)
+{
+	printf("Close event\n");
+	quit = true;
+}
+
+static void uiwnd_kbd_event(ui_window_t *window, void *arg, kbd_event_t *event)
 {
 	printf("Keyboard event type=%d key=%d\n", event->type, event->key);
@@ -863,6 +885,6 @@
 		if (rc != EOK)
 			return 1;
-	} else if (str_cmp(argv[i], "canvas") == 0) {
-		rc = demo_canvas(display_svc);
+	} else if (str_cmp(argv[i], "ui") == 0) {
+		rc = demo_ui(display_svc);
 		if (rc != EOK)
 			return 1;
Index: uspace/app/gfxdemo/meson.build
===================================================================
--- uspace/app/gfxdemo/meson.build	(revision 66a2becf49f1f530dd13dbf6fc8236890fb7f907)
+++ uspace/app/gfxdemo/meson.build	(revision b93ec7c0b1ad687158c0b60742ae81046302f956)
@@ -27,5 +27,5 @@
 #
 
-deps = [ 'gfx', 'gfxfont', 'guigfx', 'congfx', 'ipcgfx', 'display' ]
+deps = [ 'gfx', 'gfxfont', 'ui', 'congfx', 'ipcgfx', 'display' ]
 src = files(
 	'gfxdemo.c',
