Index: uspace/lib/gui/window.c
===================================================================
--- uspace/lib/gui/window.c	(revision b43edabea6b4e7a51e81261a5aec4d8b514e4e8f)
+++ uspace/lib/gui/window.c	(revision 0a052b087f4f2a5bf35eefa42452c3e975cbc319)
@@ -83,10 +83,14 @@
 static pixel_t color_caption_unfocus = PIXEL(255, 207, 207, 207);
 
+static void window_focus_event(void *);
 static void window_kbd_event(void *, kbd_event_t *);
 static void window_pos_event(void *, pos_event_t *);
+static void window_unfocus_event(void *);
 
 static display_wnd_cb_t window_cb = {
+	.focus_event = window_focus_event,
 	.kbd_event = window_kbd_event,
-	.pos_event = window_pos_event
+	.pos_event = window_pos_event,
+	.unfocus_event = window_unfocus_event
 };
 
@@ -587,8 +591,4 @@
 			break;
 		case ET_POSITION_EVENT:
-			if (!win->is_focused) {
-				win->is_focused = true;
-				handle_refresh(win);
-			}
 			deliver_position_event(win, event->data.pos);
 			break;
@@ -766,4 +766,18 @@
 }
 
+static void window_focus_event(void *arg)
+{
+	window_t *win = (window_t *) arg;
+	window_event_t *event;
+
+	event = (window_event_t *) calloc(1, sizeof(window_event_t));
+	if (event == NULL)
+		return;
+
+	link_initialize(&event->link);
+	event->type = ET_WINDOW_FOCUS;
+	prodcons_produce(&win->events, &event->link);
+}
+
 static void window_kbd_event(void *arg, kbd_event_t *kevent)
 {
@@ -796,4 +810,18 @@
 }
 
+static void window_unfocus_event(void *arg)
+{
+	window_t *win = (window_t *) arg;
+	window_event_t *event;
+
+	event = (window_event_t *) calloc(1, sizeof(window_event_t));
+	if (event == NULL)
+		return;
+
+	link_initialize(&event->link);
+	event->type = ET_WINDOW_UNFOCUS;
+	prodcons_produce(&win->events, &event->link);
+}
+
 /** @}
  */
