chromafiler
chromafiler copied to clipboard
View state property bag sometimes doesn't work
Sometimes view state settings can't be written to the IPropertyBag -- every call to Write fails with E_FAIL. This happens inconsistently.
Notes:
- This seems more likely to happen if the parent folder has never been visited
- For files (not folders), it can also happen if the parent folder was visited for the first time and hasn't been closed yet.
- Releasing and re-creating the prop bag doesn't resolve the issue.
- Closing and reopening both the parent folder and the file window sometimes resolves the issue.
- Can only reproduce in v0.7.0 or later
- ~~
SHGetViewStatePropertyBagis only specified to work for folders, so this might be an issue of using the API out-of-spec. I assumed it wasn't actually looking at the namespace and it would make no difference, but maybe this isn't the case. Or maybe it has something to do with the shell view also using the property bag, which wouldn't happen for files?~~
Bug was introduced for folders in 6192f99f72640a77300c55d0781948c1a37ae1c8 (files were already broken)
Bug was introduced for files in 0ebaa67b11c731ab99934d6857d8c001702eebc2 (first commit where files can have view state)
Idea: only write view state on close (item change marks dirty)
https://stackoverflow.com/a/56803447