commit - 7eaae9672b1be06813f6034440861209cc7397be
commit + 1004088d94d881798e672c949102600ef67e65be
blob - a2e7ba4fcc8bfa64d1dafd6b52f43b69f94c2ece
blob + 049b067eeb76201f67b9f762c94d20dc95032827
--- tog/tog.c
+++ tog/tog.c
PANEL *panel;
int nlines, ncols, begin_y, begin_x;
int lines, cols; /* copies of LINES and COLS */
+ int focussed;
struct tog_view *parent;
struct tog_view *child;
show_panel(view->parent->panel);
}
- show_panel(view->panel);
err = view->show(view);
if (err)
return err;
+ show_panel(view->panel);
if (view->child && view->child->begin_x > view->begin_x) {
err = view->child->show(view->child);
*focus = next;
else
*focus = TAILQ_FIRST(views);
+ view->focussed = 0;
+ (*focus)->focussed = 1;
break;
case '~':
prev = TAILQ_PREV(view, tog_view_list_head, entry);
*focus = prev;
else
*focus = TAILQ_LAST(views, tog_view_list_head);
+ view->focussed = 0;
+ (*focus)->focussed = 1;
break;
case 'q':
err = view->input(new, dead, view, ch);
int
view_needs_focus_indication(struct tog_view *view)
{
- PANEL *top_panel = panel_below(NULL);
- if (view->panel != top_panel)
+ if (!view->focussed)
return 0;
if (view->child && view->child->begin_x > view->begin_x)
TAILQ_INIT(&views);
TAILQ_INSERT_HEAD(&views, view, entry);
+ view->focussed = 1;
while (!TAILQ_EMPTY(&views) && !done) {
err = view_show(view);
if (err)
view = dead_view->parent;
else
view = TAILQ_LAST(&views, tog_view_list_head);
+ if (view)
+ view->focussed = 1;
err = view_close(dead_view);
if (err)
goto done;
}
if (new_view) {
struct tog_view *v, *t;
+ view->focussed = 0;
/* Only allow one view per type. */
TAILQ_FOREACH_SAFE(v, &views, entry, t) {
if (v->type != new_view->type)
err = view_set_child(new_view->parent, new_view);
if (err)
goto done;
+ new_view->parent->focussed = 0;
}
view = new_view;
+ view->focussed = 1;
}
}
done: