Index: uspace/app/taskbar/test/wndlist.c
===================================================================
--- uspace/app/taskbar/test/wndlist.c	(revision 68d68e9763bdb1e3051435500a9dc659c164070d)
+++ uspace/app/taskbar/test/wndlist.c	(revision c4a532808937c922172db7bb84d8491f7ec90f07)
@@ -407,4 +407,47 @@
 }
 
+/** Test wndlist_last() */
+PCUT_TEST(last)
+{
+	errno_t rc;
+	ui_t *ui = NULL;
+	ui_wnd_params_t params;
+	ui_window_t *window = NULL;
+	ui_fixed_t *fixed = NULL;
+	wndlist_t *wndlist;
+	wndlist_entry_t *entry;
+
+	rc = ui_create_disp(NULL, &ui);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	ui_wnd_params_init(&params);
+	params.caption = "Hello";
+
+	rc = ui_window_create(ui, &params, &window);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+	PCUT_ASSERT_NOT_NULL(window);
+
+	rc = ui_fixed_create(&fixed);
+	ui_window_add(window, ui_fixed_ctl(fixed));
+
+	rc = wndlist_create(window, fixed, &wndlist);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = wndlist_append(wndlist, 1, "Foo", true);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = wndlist_append(wndlist, 2, "Bar", true);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	entry = wndlist_last(wndlist);
+	PCUT_ASSERT_NOT_NULL(entry);
+	PCUT_ASSERT_INT_EQUALS(2, entry->wnd_id);
+
+	wndlist_destroy(wndlist);
+
+	ui_window_destroy(window);
+	ui_destroy(ui);
+}
+
 /** Test wndlist_count() */
 PCUT_TEST(count)
Index: uspace/app/taskbar/types/wndlist.h
===================================================================
--- uspace/app/taskbar/types/wndlist.h	(revision 68d68e9763bdb1e3051435500a9dc659c164070d)
+++ uspace/app/taskbar/types/wndlist.h	(revision c4a532808937c922172db7bb84d8491f7ec90f07)
@@ -57,4 +57,6 @@
 	/** Window button */
 	ui_pbutton_t *button;
+	/** Window button rectangle */
+	gfx_rect_t rect;
 } wndlist_entry_t;
 
@@ -76,4 +78,7 @@
 	list_t entries;
 
+	/** Current button pitch */
+	gfx_coord_t pitch;
+
 	/** Window management service */
 	wndmgt_t *wndmgt;
Index: uspace/app/taskbar/wndlist.c
===================================================================
--- uspace/app/taskbar/wndlist.c	(revision 68d68e9763bdb1e3051435500a9dc659c164070d)
+++ uspace/app/taskbar/wndlist.c	(revision c4a532808937c922172db7bb84d8491f7ec90f07)
@@ -34,4 +34,5 @@
 
 #include <gfx/coord.h>
+#include <gfx/render.h>
 #include <stdbool.h>
 #include <stddef.h>
@@ -91,4 +92,5 @@
     wndlist_t **rwndlist)
 {
+	ui_resource_t *res = ui_window_get_res(window);
 	wndlist_t *wndlist = NULL;
 	errno_t rc;
@@ -103,4 +105,10 @@
 	wndlist->fixed = fixed;
 	list_initialize(&wndlist->entries);
+
+	if (ui_resource_is_textmode(res))
+		wndlist->pitch = wndlist_button_pitch_max_text;
+	else
+		wndlist->pitch = wndlist_button_pitch_max;
+
 	*rwndlist = wndlist;
 	return EOK;
@@ -223,19 +231,25 @@
 	entry->visible = false;
 
-	/*
-	 * Update rectangles for all entries, including @a entry, adding
-	 * it to the layout, if applicable.
-	 */
-	e = wndlist_first(wndlist);
-	while (e != NULL) {
-		wndlist_set_entry_rect(wndlist, e);
-		e = wndlist_next(e);
-	}
-
 	/* Set button callbacks */
 	ui_pbutton_set_cb(entry->button, &wndlist_button_cb, (void *)entry);
 
-	if (paint)
-		return wndlist_repaint(wndlist);
+	if (wndlist_update_pitch(wndlist)) {
+		/*
+		 * Update rectangles for all entries, including @a entry, adding
+		 * it to the layout, if applicable.
+		 */
+		e = wndlist_first(wndlist);
+		while (e != NULL) {
+			wndlist_set_entry_rect(wndlist, e);
+			e = wndlist_next(e);
+		}
+
+		if (paint)
+			return wndlist_repaint(wndlist);
+	} else {
+		wndlist_set_entry_rect(wndlist, entry);
+		if (paint)
+			return ui_pbutton_paint(entry->button);
+	}
 
 	return EOK;
@@ -260,75 +274,75 @@
 {
 	wndlist_entry_t *e;
+	wndlist_entry_t *next;
+	wndlist_entry_t *last;
+	errno_t rc = EOK;
+
 	assert(entry->wndlist == wndlist);
+	next = wndlist_next(entry);
+
+	/* Remember last entry */
+	last = wndlist_last(wndlist);
 
 	if (entry->visible)
 		ui_fixed_remove(wndlist->fixed, ui_pbutton_ctl(entry->button));
+	list_remove(&entry->lentries);
+
+	if (wndlist_update_pitch(wndlist)) {
+		/*
+		 * Update rectangles for all entries.
+		 */
+		e = wndlist_first(wndlist);
+		while (e != NULL) {
+			wndlist_set_entry_rect(wndlist, e);
+			e = wndlist_next(e);
+		}
+
+		if (paint)
+			rc = wndlist_repaint(wndlist);
+	} else {
+		/* Unpaint the last entry */
+		if (paint)
+			rc = wndlist_unpaint_entry(last);
+
+		/*
+		 * Update rectangles for entries to the right
+		 */
+
+		e = NULL;
+		while (next != NULL) {
+			e = next;
+
+			wndlist_set_entry_rect(wndlist, e);
+			if (paint) {
+				rc = ui_pbutton_paint(e->button);
+				if (rc != EOK)
+					return rc;
+			}
+
+			next = wndlist_next(e);
+		}
+	}
+
 	ui_pbutton_destroy(entry->button);
-	list_remove(&entry->lentries);
 	free(entry);
-
-	/* Update positions of the all entries */
-	e = wndlist_first(wndlist);
-	while (e != NULL) {
-		wndlist_set_entry_rect(wndlist, e);
-		e = wndlist_next(e);
-	}
-
-	if (!paint)
-		return EOK;
-
-	return wndlist_repaint(wndlist);
-}
-
-/** Update window list entry.
- *
- * @param wndlist Window list
- * @param entry Window list entry
- * @return @c EOK on success or an error code
- */
-errno_t wndlist_update(wndlist_t *wndlist, wndlist_entry_t *entry,
-    const char *caption)
-{
-	errno_t rc;
-	assert(entry->wndlist == wndlist);
-
-	rc = ui_pbutton_set_caption(entry->button, caption);
-	if (rc != EOK)
-		return rc;
-
-	rc = ui_pbutton_paint(entry->button);
-	if (rc != EOK)
-		return rc;
-
-	return wndlist_repaint(wndlist);
-}
-
-/** Compute and set window list entry rectangle.
- *
- * Compute rectangle for window list entry and set it.
- *
- * @param wndlist Window list
- * @param entry Window list entry
- */
-void wndlist_set_entry_rect(wndlist_t *wndlist, wndlist_entry_t *entry)
-{
-	wndlist_entry_t *e;
-	gfx_rect_t rect;
+	return rc;
+}
+
+/** Update button pitch.
+ *
+ * Recalculatebutton pitch @c wndlist->pitch based on current number
+ * of buttons.
+ *
+ * @param wndlist Window list
+ * @return @c true iff pitch changed
+ */
+bool wndlist_update_pitch(wndlist_t *wndlist)
+{
 	ui_resource_t *res;
+	size_t nbuttons;
 	gfx_coord_t pitch;
 	gfx_coord_t pitch_max;
 	gfx_coord_t pitch_min;
 	gfx_coord_t pad;
-	size_t idx;
-	size_t nbuttons;
-
-	/* Determine entry index */
-	idx = 0;
-	e = wndlist_first(wndlist);
-	while (e != entry) {
-		assert(e != NULL);
-		e = wndlist_next(e);
-		++idx;
-	}
 
 	res = ui_window_get_res(wndlist->window);
@@ -346,9 +360,79 @@
 	/* Compute pitch that fits all buttons perfectly */
 	nbuttons = wndlist_count(wndlist);
-	pitch = (wndlist->rect.p1.x - wndlist->rect.p0.x + pad) / nbuttons;
+	if (nbuttons > 0)
+		pitch = (wndlist->rect.p1.x - wndlist->rect.p0.x + pad) / nbuttons;
+	else
+		pitch = pitch_min;
+
 	if (pitch < pitch_min)
 		pitch = pitch_min;
 	if (pitch > pitch_max)
 		pitch = pitch_max;
+
+	/* Did the pitch change? */
+	if (pitch == wndlist->pitch)
+		return false;
+
+	wndlist->pitch = pitch;
+	return true;
+}
+
+/** Update window list entry.
+ *
+ * @param wndlist Window list
+ * @param entry Window list entry
+ * @return @c EOK on success or an error code
+ */
+errno_t wndlist_update(wndlist_t *wndlist, wndlist_entry_t *entry,
+    const char *caption)
+{
+	errno_t rc;
+	assert(entry->wndlist == wndlist);
+
+	rc = ui_pbutton_set_caption(entry->button, caption);
+	if (rc != EOK)
+		return rc;
+
+	rc = ui_pbutton_paint(entry->button);
+	if (rc != EOK)
+		return rc;
+
+	return wndlist_repaint(wndlist);
+}
+
+/** Compute and set window list entry rectangle.
+ *
+ * Compute rectangle for window list entry and set it.
+ *
+ * @param wndlist Window list
+ * @param entry Window list entry
+ */
+void wndlist_set_entry_rect(wndlist_t *wndlist, wndlist_entry_t *entry)
+{
+	wndlist_entry_t *e;
+	gfx_rect_t rect;
+	ui_resource_t *res;
+	gfx_coord_t pitch;
+	gfx_coord_t pad;
+	size_t idx;
+
+	/* Determine entry index */
+	idx = 0;
+	e = wndlist_first(wndlist);
+	while (e != entry) {
+		assert(e != NULL);
+		e = wndlist_next(e);
+		++idx;
+	}
+
+	res = ui_window_get_res(wndlist->window);
+
+	if (ui_resource_is_textmode(res)) {
+		pad = wndlist_button_pad_text;
+	} else {
+		pad = wndlist_button_pad;
+	}
+
+	pitch = wndlist->pitch;
 
 	rect.p0.x = wndlist->rect.p0.x + pitch * idx;
@@ -375,4 +459,34 @@
 
 	ui_pbutton_set_rect(entry->button, &rect);
+	entry->rect = rect;
+}
+
+/** Compute and set window list entry rectangle.
+ *
+ * Compute rectangle for window list entry and set it.
+ *
+ * @param entry Window list entry
+ * @return EOK on success or an error code
+ */
+errno_t wndlist_unpaint_entry(wndlist_entry_t *entry)
+{
+	errno_t rc;
+	gfx_context_t *gc;
+	ui_resource_t *res;
+	gfx_color_t *color;
+
+	gc = ui_window_get_gc(entry->wndlist->window);
+	res = ui_window_get_res(entry->wndlist->window);
+	color = ui_resource_get_wnd_face_color(res);
+
+	rc = gfx_set_color(gc, color);
+	if (rc != EOK)
+		return rc;
+
+	rc = gfx_fill_rect(gc, &entry->rect);
+	if (rc != EOK)
+		return rc;
+
+	return EOK;
 }
 
@@ -485,4 +599,20 @@
 }
 
+/** Get last window list entry.
+ *
+ * @param wndlist Window list
+ * @return Last entry or @c NULL if the list is empty
+ */
+wndlist_entry_t *wndlist_last(wndlist_t *wndlist)
+{
+	link_t *link;
+
+	link = list_last(&wndlist->entries);
+	if (link == NULL)
+		return NULL;
+
+	return list_get_instance(link, wndlist_entry_t, lentries);
+}
+
 /** Get next window list entry.
  *
Index: uspace/app/taskbar/wndlist.h
===================================================================
--- uspace/app/taskbar/wndlist.h	(revision 68d68e9763bdb1e3051435500a9dc659c164070d)
+++ uspace/app/taskbar/wndlist.h	(revision c4a532808937c922172db7bb84d8491f7ec90f07)
@@ -52,11 +52,14 @@
 extern errno_t wndlist_append(wndlist_t *, sysarg_t, const char *, bool);
 extern errno_t wndlist_remove(wndlist_t *, wndlist_entry_t *, bool);
+extern bool wndlist_update_pitch(wndlist_t *);
 extern errno_t wndlist_update(wndlist_t *, wndlist_entry_t *, const char *);
 extern void wndlist_set_entry_rect(wndlist_t *, wndlist_entry_t *);
 extern wndlist_entry_t *wndlist_entry_by_id(wndlist_t *, sysarg_t);
 extern wndlist_entry_t *wndlist_first(wndlist_t *);
+extern wndlist_entry_t *wndlist_last(wndlist_t *);
 extern wndlist_entry_t *wndlist_next(wndlist_entry_t *);
 extern size_t wndlist_count(wndlist_t *);
 extern errno_t wndlist_repaint(wndlist_t *);
+extern errno_t wndlist_unpaint_entry(wndlist_entry_t *);
 
 #endif
