Skip to content

treeview: Use filtered path to select correct entry when navigating to bookmark and "Show applications without children" is inactive.

The gtk.TreeView methods called in _selectExistingPath operate on AccessibleTreeView's model, which is the filtered model (self.filter, s. the call to self.set_model(self.filter) in the AccessibleTreeView constructor).

Since the path to the unfiltered model (self.model) gets passed as a parameter, convert this to the filtered path before using it to select an item.

This fixes navigating to a bookmark when "View" -> "Show applications without children" is disabled (the default), which was otherwise using a too large row index in the path if any hidden applications had a lower row index than the bookmarked application.

The two attached screencasts show the behavior with and without the fix in place:

master as of 7a387fe3, i.e. without the fix:

2022-07-04_screencast_accerciser_master_bookmark_restore

with the fix in place:

2022-07-04_screencast_accerciser_fixed_bookmark_restore

It's still a bit odd that the bookmark has to be clicked twice to actually jump to the bookmarked position, but that's unrelated to this MR. (Happens for master and the "Show applications without children" option enabled just the same, just isn't visible in the video because the bookmark has been clicked earlier, which apparently triggers something that's needed in the follow-up attempt.)

Merge request reports