Only try and select the last row if not already selected. This fix doesn't seem to...
authorkrj <krj@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 2 Sep 2009 19:31:56 +0000 (19:31 +0000)
committerkrj <krj@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 2 Sep 2009 19:31:56 +0000 (19:31 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@29677 f5534014-38df-0310-8fa8-9805f1628bb7

file.c
gtk/new_packet_list.c

diff --git a/file.c b/file.c
index 6c9e7b4756e3c16adc0748fa32afcbb10efa96d8..5a90bbea9bdec9270260c842920c5a948b3c1689 100644 (file)
--- a/file.c
+++ b/file.c
@@ -798,7 +798,7 @@ cf_continue_tail(capture_file *cf, volatile int to_read, int *err)
 #ifdef NEW_PACKET_LIST
         new_packet_list_thaw();
 #else
-       packet_list_thaw();
+        packet_list_thaw();
 #endif
         return CF_READ_ABORTED;
     }
index 80a97822f1dff2063e7f64a791bd2759ff8987f2..fe3fbec995e1c87a1637bf21bdfe4f62837b32e1 100644 (file)
@@ -350,15 +350,19 @@ new_packet_list_moveto_end(void)
        if(!gtk_tree_model_iter_nth_child(model, &iter, NULL, last_row))
                return;
 
-       selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(packetlist->view));
-       gtk_tree_selection_select_iter (selection, &iter);
        path = gtk_tree_model_get_path(model, &iter);
-       gtk_tree_view_scroll_to_cell(GTK_TREE_VIEW(packetlist->view),
-                       path,
-                       NULL,
-                       TRUE,   /* use_align */
-                       0.5,    /* row_align determines where the row is placed, 0.5 means center */
-                       0);             /* The horizontal alignment of the column */
+       selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(packetlist->view));
+
+       if (!gtk_tree_selection_path_is_selected(selection, path)) {
+               /* XXX - this doesn't seem to work, i.e. gtk_tree_selection_path_is_selected() is always false? */
+               gtk_tree_selection_select_path(selection, path);
+               gtk_tree_view_scroll_to_cell(GTK_TREE_VIEW(packetlist->view),
+                               path,
+                               NULL,
+                               TRUE,   /* use_align */
+                               0.5,    /* row_align determines where the row is placed, 0.5 means center */
+                               0);             /* The horizontal alignment of the column */
+       }
 
        gtk_tree_path_free(path);
 }