GtkTreeSelection *selection;
GtkTreeIter iter;
GtkTreeModel *model;
+ GtkWidget *focus = gtk_window_get_focus(GTK_WINDOW(top_level));
selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(packetlist->view));
if (!gtk_tree_selection_get_selected(selection, NULL, &iter))
return;
scroll_to_and_select_iter(&iter);
+
+ /* Set the focus back where it was */
+ if (focus)
+ gtk_window_set_focus(GTK_WINDOW(top_level), focus);
}
void
GtkTreeIter iter;
GtkTreeModel *model;
GtkTreePath *path;
+ GtkWidget *focus = gtk_window_get_focus(GTK_WINDOW(top_level));
selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(packetlist->view));
if (!gtk_tree_selection_get_selected(selection, NULL, &iter))
scroll_to_and_select_iter(&iter);
gtk_tree_path_free(path);
+
+ /* Set the focus back where it was */
+ if (focus)
+ gtk_window_set_focus(GTK_WINDOW(top_level), focus);
}
static void