Adwleaflet: Preserve scrollbar position between pages
Discovered in gnome-software#1497 (closed) and moving it here, because I do not see a way how to workaround this from the Software side (there's no access to the scrolled window of an AdwPreferencesPage
).
The main
branch switched to gtk4 and libadwaita. When going to the Updates tab and clicking "OS Updates" application, it lists the respective packages in this widget structure:
The list can be long, thus the AdwPreferencesPage can scroll down. When an application is clicked, it's shown in the same AdwLeaflet:
with a Back
button at the top. When the Back
button is clicked the previous AdwPreferencesPage is shown (by adw_leaflet_navigate (ADW_LEAFLET (dialog->leaflet), ADW_NAVIGATION_DIRECTION_BACK);
) and the previously shown page is removed. The problem is that the leaflet doesn't scroll to the position where it was before, but to the top (even not to the very top). That's pretty bad, because when a user wants to see what changed he/she ends in a constant re-scrolling towards the bottom after reviewing a single package update information.