Quote:
Originally Posted by Yil
Try this. Select a file say #6 and move it to the top (transfer in progress, not sure if that matters), now it's one down from the top, press the shift button and click #4 to select everything between them in the queue. The newly selected range is not #2-#4 but rather #6-#4. It's using the original position of the item before the move to top operation.
|
I was able to reproduce this selection oddity, it took the better part of the day to figure out a to way to work around it, but I did.
For awhile there I wasn't sure if it was a virtual listview bug or something goofy with my implementation.. the problem is that if you move an item and change the selection/focus state the visual listview doesn't keep proper sync with the data backend.
Unselecting all items and then updating the item state of the selected/focused items didn't work (it works but breaks the multi-select item selection as you've indicated above), which in my opinion is the most logical way to update the item states.
Finally I found a solution which is to empty the visual listview and then re-add them, then adjust the item selection/focus states.
I need to do some more testing to ensure these changes don't cause any side effects as well as apply these changes to both the local and remote listviews, they appear to be effected by this issue when refreshing a directory or after a compare folder content w/ hide matches.
[UPDATE]
Turns out this solution has some side effects.. Further research has revealed the problem boils down to the fact that a shift select triggers LVN_ODSTATECHANGED with the range of the items that changed. When LVN_ODSTATECHANGED is used instead of LVN_ITEMCHANGED the item focus tracking isn't properly preserved.
My new solution is to detect situations that would trigger LVN_ODSTATECHANGED and override it with my own custom item selection code eliminating the problem.
I am testing the new code on Win2000, WinXP, Win2003, Win2008 R2, Win7, and under Wine, so far everything seems to work, once I complete my tests I will post a new build.
[OFF-TOPIC]
I did discover an unexpected and unrelated bug when running FlashFXP under Wine. Starting in v4.2 we switched from the standard windows timer (WM_TIMER) to a threaded high-resolution event timer, the new threaded timer has a critical section re-entry glitch causing the timer thread to dead-lock.
Ironically this issue was undetected and went unnoticed under Windows.
This dead-lock issue might explain a couple open bug reports that I haven't been able to solve, specifically the ones related to remote editing and edit and upload not triggering an event for uploading/prompting on save.