[gnome-software: 1/2] gs-category-page: Fix view scrolling if clicking tiles near the top




commit f45a4e24d3927f1c95a9f29d42f7a016879540e7
Author: Philip Withnall <pwithnall endlessos org>
Date:   Mon Nov 23 10:56:44 2020 +0000

    gs-category-page: Fix view scrolling if clicking tiles near the top
    
    This was introduced in commit 997c6b5f and broken in/around commit
    a8e93c9caa, and was supposed to scroll the
    view to show the tile that had just been clicked on (or which was
    focused by using the arrow keys on the keyboard). However, that
    (specifically `gtk_container_set_focus_vadjustment()`) only works if the
    child widgets are in the same coordinate system as the container. That’s
    not the case here, as `featured_grid` (and other widgets) are between
    `scrolledwindow_category` and `category_detail_box` in the widget
    hierarchy. That means the scrolling jumps to the wrong place, and the
    tile isn’t activated.
    
    It might be possible to reimplement the mechanics of
    `gtk_container_set_focus_vadjustment()` in gnome-software, but that
    seems like a lot of fragile code for a small feature. Instead, just drop
    it.
    
    Signed-off-by: Philip Withnall <pwithnall endlessos org>
    
    Fixes: #1040

 src/gs-category-page.c | 3 ---
 1 file changed, 3 deletions(-)
---
diff --git a/src/gs-category-page.c b/src/gs-category-page.c
index 0608ac81..77b0c3ab 100644
--- a/src/gs-category-page.c
+++ b/src/gs-category-page.c
@@ -531,7 +531,6 @@ gs_category_page_setup (GsPage *page,
                         GError **error)
 {
        GsCategoryPage *self = GS_CATEGORY_PAGE (page);
-       GtkAdjustment *adj;
 
        self->plugin_loader = g_object_ref (plugin_loader);
        self->builder = g_object_ref (builder);
@@ -550,8 +549,6 @@ gs_category_page_setup (GsPage *page,
                                                       G_CALLBACK (sort_button_clicked),
                                                       self);
 
-       adj = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (self->scrolledwindow_category));
-       gtk_container_set_focus_vadjustment (GTK_CONTAINER (self->category_detail_box), adj);
        return TRUE;
 }
 


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