[gnome-system-monitor/gnome-3-8] Revert "Preserve tree scroll position at top/bottom when new processes are added." Based on bug 7003



commit d8763d949f3b75851552aaf66eed117a33003d62
Author: Robert Roth <robert roth off gmail com>
Date:   Tue May 14 20:16:26 2013 +0300

    Revert "Preserve tree scroll position at top/bottom when new processes are added."
    Based on bug 700305
    https://bugzilla.gnome.org/show_bug.cgi?id=700305
    This reverts commit 5d139df7a3cd2922e8578d368a2f7e790577c45e.

 src/procman-app.h |    4 ----
 src/proctable.cpp |   30 +-----------------------------
 2 files changed, 1 insertions(+), 33 deletions(-)
---
diff --git a/src/procman-app.h b/src/procman-app.h
index ad9ecc0..d698649 100644
--- a/src/procman-app.h
+++ b/src/procman-app.h
@@ -201,10 +201,6 @@ public:
     guint             timeout;
     guint             disk_timeout;
 
-    GtkTreePath      *top_of_tree;
-    gdouble          last_vscroll_max;
-    gdouble          last_vscroll_value;
-
     PrettyTable      *pretty_table;
 
     GSettings        *settings;
diff --git a/src/proctable.cpp b/src/proctable.cpp
index e4da3bb..975dcc7 100644
--- a/src/proctable.cpp
+++ b/src/proctable.cpp
@@ -973,36 +973,8 @@ proctable_update_list (ProcmanApp *app)
     glibtop_get_cpu (&cpu);
     app->cpu_total_time = MAX(cpu.total - app->cpu_total_time_last, 1);
     app->cpu_total_time_last = cpu.total;
-    
-    GtkAdjustment* vadjustment = GTK_ADJUSTMENT(gtk_scrollable_get_vadjustment(GTK_SCROLLABLE(app->tree)));
+
     refresh_list (app, pid_list, proclist.number);
-    
-    // juggling with tree scroll position to fix https://bugzilla.gnome.org/show_bug.cgi?id=92724
-    GtkTreePath* current_top;
-    gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(app->tree), 0,0, &current_top, NULL, NULL, NULL);
-    gdouble current_max = gtk_adjustment_get_upper(vadjustment);
-    gdouble current_value = gtk_adjustment_get_value(vadjustment);
-    if (app->top_of_tree) {
-        // if the visible cell from the top of the tree is still the same, as last time 
-        if (gtk_tree_path_compare(app->top_of_tree, current_top) == 0) 
-        {   
-            //but something from the scroll parameters has changed compared to the last values
-            if (app->last_vscroll_value==0 && current_value!=app->last_vscroll_value) 
-            {
-                // the tree was scrolled to top, and something has been added above the current top row
-                gtk_tree_view_scroll_to_point(GTK_TREE_VIEW(app->tree), -1, 0);
-            } 
-            else if (current_max > app->last_vscroll_max && current_value == app->last_vscroll_value)
-            {
-                // the tree was scrolled to bottom, something has been added below the current bottom row
-                gtk_tree_view_scroll_to_point(GTK_TREE_VIEW(app->tree), -1, current_max);
-            }
-        }
-        gtk_tree_path_free(app->top_of_tree);
-    }
-    app->top_of_tree = current_top;
-    app->last_vscroll_value = current_value;
-    app->last_vscroll_max = current_max;
 
     g_free (pid_list);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]