Index: uspace/app/nav/test/panel.c
===================================================================
--- uspace/app/nav/test/panel.c	(revision 2fb495228984165d057f71bfa95d721845722687)
+++ uspace/app/nav/test/panel.c	(revision 692c7f40369e2c44dc1847d6acc7f45ea36d1934)
@@ -46,5 +46,5 @@
 	errno_t rc;
 
-	rc = panel_create(NULL, &panel);
+	rc = panel_create(NULL, true, &panel);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -70,5 +70,5 @@
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
-	rc = panel_create(window, &panel);
+	rc = panel_create(window, true, &panel);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -102,5 +102,5 @@
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
-	rc = panel_create(window, &panel);
+	rc = panel_create(window, true, &panel);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -120,5 +120,5 @@
 	errno_t rc;
 
-	rc = panel_create(NULL, &panel);
+	rc = panel_create(NULL, true, &panel);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -133,14 +133,12 @@
 {
 	panel_t *panel;
-	ui_control_t *control;
 	ui_evclaim_t claimed;
 	kbd_event_t event;
 	errno_t rc;
 
-	rc = panel_create(NULL, &panel);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	control = panel_ctl(panel);
-	PCUT_ASSERT_NOT_NULL(control);
+	/* Active panel should claim events */
+
+	rc = panel_create(NULL, true, &panel);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
 	event.type = KEY_PRESS;
@@ -150,4 +148,19 @@
 
 	claimed = panel_kbd_event(panel, &event);
+	PCUT_ASSERT_EQUALS(ui_claimed, claimed);
+
+	panel_destroy(panel);
+
+	/* Inactive panel should not claim events */
+
+	rc = panel_create(NULL, false, &panel);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	event.type = KEY_PRESS;
+	event.key = KC_ENTER;
+	event.mods = 0;
+	event.c = '\0';
+
+	claimed = panel_kbd_event(panel, &event);
 	PCUT_ASSERT_EQUALS(ui_unclaimed, claimed);
 
@@ -159,14 +172,10 @@
 {
 	panel_t *panel;
-	ui_control_t *control;
 	ui_evclaim_t claimed;
 	pos_event_t event;
 	errno_t rc;
 
-	rc = panel_create(NULL, &panel);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	control = panel_ctl(panel);
-	PCUT_ASSERT_NOT_NULL(control);
+	rc = panel_create(NULL, true, &panel);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
 	event.pos_id = 0;
@@ -186,13 +195,9 @@
 {
 	panel_t *panel;
-	ui_control_t *control;
 	gfx_rect_t rect;
 	errno_t rc;
 
-	rc = panel_create(NULL, &panel);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	control = panel_ctl(panel);
-	PCUT_ASSERT_NOT_NULL(control);
+	rc = panel_create(NULL, true, &panel);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
 	rect.p0.x = 1;
@@ -214,13 +219,9 @@
 {
 	panel_t *panel;
-	ui_control_t *control;
 	gfx_rect_t rect;
 	errno_t rc;
 
-	rc = panel_create(NULL, &panel);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	control = panel_ctl(panel);
-	PCUT_ASSERT_NOT_NULL(control);
+	rc = panel_create(NULL, true, &panel);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
 	rect.p0.x = 10;
@@ -237,4 +238,81 @@
 }
 
+/** panel_is_active() returns panel activity state */
+PCUT_TEST(is_active)
+{
+	panel_t *panel;
+	errno_t rc;
+
+	rc = panel_create(NULL, true, &panel);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+	PCUT_ASSERT_TRUE(panel_is_active(panel));
+	panel_destroy(panel);
+
+	rc = panel_create(NULL, false, &panel);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+	PCUT_ASSERT_FALSE(panel_is_active(panel));
+	panel_destroy(panel);
+}
+
+/** panel_activate() activates panel */
+PCUT_TEST(activate)
+{
+	ui_t *ui;
+	ui_window_t *window;
+	ui_wnd_params_t params;
+	panel_t *panel;
+	errno_t rc;
+
+	rc = ui_create_disp(NULL, &ui);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	ui_wnd_params_init(&params);
+	params.caption = "Test";
+
+	rc = ui_window_create(ui, &params, &window);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = panel_create(window, false, &panel);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	PCUT_ASSERT_FALSE(panel_is_active(panel));
+	panel_activate(panel);
+	PCUT_ASSERT_TRUE(panel_is_active(panel));
+
+	panel_destroy(panel);
+	ui_window_destroy(window);
+	ui_destroy(ui);
+}
+
+/** panel_deactivate() deactivates panel */
+PCUT_TEST(deactivate)
+{
+	ui_t *ui;
+	ui_window_t *window;
+	ui_wnd_params_t params;
+	panel_t *panel;
+	errno_t rc;
+
+	rc = ui_create_disp(NULL, &ui);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	ui_wnd_params_init(&params);
+	params.caption = "Test";
+
+	rc = ui_window_create(ui, &params, &window);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = panel_create(window, true, &panel);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	PCUT_ASSERT_TRUE(panel_is_active(panel));
+	panel_deactivate(panel);
+	PCUT_ASSERT_FALSE(panel_is_active(panel));
+
+	panel_destroy(panel);
+	ui_window_destroy(window);
+	ui_destroy(ui);
+}
+
 /** panel_entry_append() appends new entry */
 PCUT_TEST(entry_append)
@@ -243,5 +321,5 @@
 	errno_t rc;
 
-	rc = panel_create(NULL, &panel);
+	rc = panel_create(NULL, true, &panel);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -266,5 +344,5 @@
 	errno_t rc;
 
-	rc = panel_create(NULL, &panel);
+	rc = panel_create(NULL, true, &panel);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -296,5 +374,5 @@
 	errno_t rc;
 
-	rc = panel_create(NULL, &panel);
+	rc = panel_create(NULL, true, &panel);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -345,5 +423,5 @@
 	PCUT_ASSERT_INT_EQUALS(0, rv);
 
-	rc = panel_create(NULL, &panel);
+	rc = panel_create(NULL, true, &panel);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -375,5 +453,5 @@
 	errno_t rc;
 
-	rc = panel_create(NULL, &panel);
+	rc = panel_create(NULL, true, &panel);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -411,5 +489,5 @@
 	errno_t rc;
 
-	rc = panel_create(NULL, &panel);
+	rc = panel_create(NULL, true, &panel);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -447,5 +525,5 @@
 	errno_t rc;
 
-	rc = panel_create(NULL, &panel);
+	rc = panel_create(NULL, true, &panel);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -484,5 +562,5 @@
 	errno_t rc;
 
-	rc = panel_create(NULL, &panel);
+	rc = panel_create(NULL, true, &panel);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -538,5 +616,5 @@
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
-	rc = panel_create(window, &panel);
+	rc = panel_create(window, true, &panel);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -619,5 +697,5 @@
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
-	rc = panel_create(window, &panel);
+	rc = panel_create(window, true, &panel);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -702,5 +780,5 @@
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
-	rc = panel_create(window, &panel);
+	rc = panel_create(window, true, &panel);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -763,5 +841,5 @@
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
-	rc = panel_create(window, &panel);
+	rc = panel_create(window, true, &panel);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -825,5 +903,5 @@
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
-	rc = panel_create(window, &panel);
+	rc = panel_create(window, true, &panel);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -913,5 +991,5 @@
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
-	rc = panel_create(window, &panel);
+	rc = panel_create(window, true, &panel);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
