From Jim Young via bug 4033:
authorkrj <krj@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 20 Sep 2009 19:39:54 +0000 (19:39 +0000)
committerkrj <krj@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 20 Sep 2009 19:39:54 +0000 (19:39 +0000)
With the "old" list if keyboard focus was initially in the details pane, the
use of the <F7>/<F8> keys will restore focus to details pane after the
prev/next move.   Without this patch "new" packet list prev/next moves simply
moves focus to summary pane.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@30025 f5534014-38df-0310-8fa8-9805f1628bb7

gtk/new_packet_list.c

index d2cee6cac64651fafab40b340218ff448d0e1c99..be5360c484ca0e7981f5e184d4beac45b0f63035 100644 (file)
@@ -309,6 +309,7 @@ new_packet_list_next(void)
        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))
@@ -319,6 +320,10 @@ new_packet_list_next(void)
                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
@@ -328,6 +333,7 @@ new_packet_list_prev(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))
@@ -345,6 +351,10 @@ new_packet_list_prev(void)
        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