GtkWidget *window;
GtkWidget *menu_item;
GtkWidget *tab_item;
+ GtkWidget *focus;
VirtualConsoleType type;
union {
VirtualGfxConsole gfx;
GtkDisplayState *s = opaque;
VirtualConsole *vc = gd_vc_find_by_menu(s);
GtkNotebook *nb = GTK_NOTEBOOK(s->notebook);
- GtkWidget *child;
gint page;
gtk_release_modifiers(s);
if (vc) {
page = gtk_notebook_page_num(nb, vc->tab_item);
gtk_notebook_set_current_page(nb, page);
- child = gtk_notebook_get_nth_page(nb, page);
- gtk_widget_grab_focus(child);
+ gtk_widget_grab_focus(vc->focus);
}
}
vc->type = GD_VC_VTE;
vc->tab_item = box;
+ vc->focus = vc->vte.terminal;
gtk_notebook_append_page(GTK_NOTEBOOK(s->notebook), vc->tab_item,
gtk_label_new(vc->label));
vc->type = GD_VC_GFX;
vc->tab_item = vc->gfx.drawing_area;
+ vc->focus = vc->gfx.drawing_area;
gtk_notebook_append_page(GTK_NOTEBOOK(s->notebook),
vc->tab_item, gtk_label_new(vc->label));