Skip to content

pathbar: Really fix automatic scrolling

Corey Berla requested to merge wip/corey/pathbar-scrolling into main

Commit 6a0f4832 ("pathbar: Fix automatically scrolling") attempted to ensure that the last folder was always shown (scrolled to), by using a 800ms animation (in order to scroll in the next main context iteration). This was necessary because the scrolled window actually expands async after the adjustment size has changed. This solution was actually quite flaky, but usually not obvious. Until now, you would probably only notice this issue if you had a long path opened, opened a New Window (in my testing sometimes it showed the current folder and sometimes it did not).

Now with the file chooser, this is a much larger issue. The file chooser window is small, and thus has a smaller pathbar (increasing the chance of the current folder cut off). Presumably, the issue may be magnified because of the amount of processing done during a file chooser load. In my testing, I consistently had file chooser that were not scrolled to the current folder, giving a false impression of what folder was actually selected (in my case it was an empty folder, so it was impossible to actually realize what had happened).

Fortunately, since the original solution was implemented, the scroll-to api was introduced to GtkViewPort. Remove the workaround and use the new api to keep the current folder scrolled into view.

Merge request reports