shell: fix position reset from thumbnails sidebar
Fixes #48 (closed)
My diagnostic of what is going on is:
- Dual mode gets triggered.
- Some signal from the top-level
document-model
triggers aSidebarThumbnail::relayout()
(I don't remember which one). -
relayout(...)
adds an empty thumbnail to start with a "blank head" on the thumbnails view. - This modifies the list model of the grid view, which in turns triggers
notify::selected
on the selection model that wraps it.- The selection index did not change (still 0), but the underlying item did (a new, blank thumbnail).
- We handle this signal as if the user clicked on a thumbnail
🙈
I'm not super confident on my fix. I need to think a bit about what happens if we regenerate the list model completely.