- /* 5 second timeout for chains */
- ob_main_loop_timeout_add(ob_main_loop, 5 * G_USEC_PER_SEC,
- chain_timeout, NULL, NULL);
- grab_keys(FALSE);
- curpos = p;
- grab_keys(TRUE);
- } else {
-
- keyboard_reset_chains();
+ /* 3 second timeout for chains */
+ ob_main_loop_timeout_add(ob_main_loop, 3 * G_USEC_PER_SEC,
+ chain_timeout, NULL,
+ g_direct_equal, NULL);
+ set_curpos(p);
+ } else if (p->chroot) /* an empty chroot */
+ set_curpos(p);
+ else {
+ GSList *it;
+ gboolean inter = FALSE;
+
+ for (it = p->actions; it && !inter; it = g_slist_next(it))
+ if (((ObAction*)it->data)->data.any.interactive)
+ inter = TRUE;
+ if (!inter) /* don't reset if the action is interactive */
+ keyboard_reset_chains(0);