Index: uspace/lib/ui/include/ui/wdecor.h
===================================================================
--- uspace/lib/ui/include/ui/wdecor.h	(revision 7b1bfdb17fcc330a202d54d51981d796f7af52f7)
+++ uspace/lib/ui/include/ui/wdecor.h	(revision 13824465fb4456a3eecfaf3c2ff08fb0cbdc3a55)
@@ -54,4 +54,6 @@
 extern void ui_wdecor_rect_from_app(ui_wdecor_style_t, gfx_rect_t *,
     gfx_rect_t *);
+extern void ui_wdecor_app_from_rect(ui_wdecor_style_t, gfx_rect_t *,
+    gfx_rect_t *);
 
 #endif
Index: uspace/lib/ui/private/window.h
===================================================================
--- uspace/lib/ui/private/window.h	(revision 7b1bfdb17fcc330a202d54d51981d796f7af52f7)
+++ uspace/lib/ui/private/window.h	(revision 13824465fb4456a3eecfaf3c2ff08fb0cbdc3a55)
@@ -43,4 +43,5 @@
 #include <io/kbd_event.h>
 #include <io/pos_event.h>
+#include <memgfx/memgc.h>
 
 /** Actual structure of window.
@@ -63,4 +64,6 @@
 	/** Application area bitmap */
 	gfx_bitmap_t *app_bmp;
+	/** Application area memory GC */
+	mem_gc_t *app_mgc;
 	/** Application area GC */
 	gfx_context_t *app_gc;
Index: uspace/lib/ui/src/wdecor.c
===================================================================
--- uspace/lib/ui/src/wdecor.c	(revision 7b1bfdb17fcc330a202d54d51981d796f7af52f7)
+++ uspace/lib/ui/src/wdecor.c	(revision 13824465fb4456a3eecfaf3c2ff08fb0cbdc3a55)
@@ -359,4 +359,30 @@
 }
 
+/** Application area rectangle from window rectangle.
+ *
+ * Note that this needs to work just based on a UI, without having an actual
+ * window decoration, since we need it in process of resizing the window,
+ * before it is actually resized.
+ *
+ * @param style Decoration style
+ * @param rect Window decoration rectangle
+ * @param app Place to store application area rectangle
+ */
+void ui_wdecor_app_from_rect(ui_wdecor_style_t style, gfx_rect_t *rect,
+    gfx_rect_t *app)
+{
+	*app = *rect;
+
+	if ((style & ui_wds_frame) != 0) {
+		app->p0.x += wdecor_edge_w;
+		app->p0.y += wdecor_edge_h;
+		app->p1.x -= wdecor_edge_w;
+		app->p1.y -= wdecor_edge_h;
+	}
+
+	if ((style & ui_wds_titlebar) != 0)
+		app->p0.y += 22;
+}
+
 /** Get resize type for pointer at the specified position.
  *
Index: uspace/lib/ui/src/window.c
===================================================================
--- uspace/lib/ui/src/window.c	(revision 7b1bfdb17fcc330a202d54d51981d796f7af52f7)
+++ uspace/lib/ui/src/window.c	(revision 13824465fb4456a3eecfaf3c2ff08fb0cbdc3a55)
@@ -292,4 +292,8 @@
 	gfx_coord2_t offs;
 	gfx_rect_t nrect;
+	gfx_rect_t arect;
+	gfx_bitmap_t *app_bmp = NULL;
+	gfx_bitmap_params_t params;
+	gfx_bitmap_alloc_t alloc;
 	errno_t rc;
 
@@ -301,14 +305,48 @@
 	gfx_rect_rtranslate(&offs, rect, &nrect);
 
+	if (window->app_gc != NULL) {
+		assert(window->app_bmp != NULL);
+
+		gfx_bitmap_params_init(&params);
+
+		/*
+		 * The bitmap will have the same dimensions as the
+		 * application rectangle, but start at 0,0.
+		 */
+		ui_wdecor_app_from_rect(window->wdecor->style, &nrect, &arect);
+		gfx_rect_rtranslate(&arect.p0, &arect, &params.rect);
+
+		rc = gfx_bitmap_create(window->gc, &params, NULL,
+		    &app_bmp);
+		if (rc != EOK)
+			goto error;
+
+		rc = gfx_bitmap_get_alloc(app_bmp, &alloc);
+		if (rc != EOK)
+			goto error;
+	}
+
 	/* dwindow can be NULL in case of unit tests */
 	if (window->dwindow != NULL) {
 		rc = display_window_resize(window->dwindow, &offs, &nrect);
 		if (rc != EOK)
-			return rc;
+			goto error;
 	}
 
 	ui_wdecor_set_rect(window->wdecor, &nrect);
 	ui_wdecor_paint(window->wdecor);
+
+	if (window->app_gc != NULL) {
+		mem_gc_retarget(window->app_mgc, &params.rect, &alloc);
+
+		gfx_bitmap_destroy(window->app_bmp);
+		window->app_bmp = app_bmp;
+	}
+
 	return EOK;
+error:
+	if (app_bmp != NULL)
+		gfx_bitmap_destroy(app_bmp);
+	return rc;
 }
 
@@ -389,4 +427,5 @@
 		}
 
+		window->app_mgc = memgc;
 		window->app_gc = mem_gc_get_ctx(memgc);
 	}
