TC window lost focus -> deselection in virtual folders

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

TC window lost focus -> deselection in virtual folders

Post by *DrShark »

To reproduce:
1. Select some items in virtual \\Desktop (cm_OpenDesktop) or \\Computer folder.
2. Make TC window to lost focus, and then restore it (Alt+Tab -> Alt+Esc, Minimize->Restore, Start/Close Search in separate process etc...):
selection lost even if virtual folder with selected items is in inactive panel.

Reproduced both with default settings and with colon (:) in the "No refresh for these drives:" option on Configuration->Refresh settings page.

Note: it's possible to restore selection lost in such case by activation of panel with virtual folder and using Mark->Restore Selection (cm_RestoreSelection) there.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

This happens because TC re-reads the virtual folder. There is no easy way to determine whether it was unchanged or not, because internal virtual folder data can change.
Author of Total Commander
https://www.ghisler.com
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Post by *DrShark »

ghisler(Author) wrote:This happens because TC re-reads the virtual folder.
The refresh happens even after a return of a focus to TC with TC option Configuration->Refresh->Auto-refresh when activating the program->No refresh for these drives: set to : (means TC shouldn't refresh virtual folders after window activation.) Maybe there is a bug in this function?
ghisler(Author) wrote:There is no easy way to determine whether it was unchanged or not, because internal virtual folder data can change.
OK, but maybe it won't be a bad solution at least to auto-restore the selection (using cm_RestoreSelection method) after refresh+selection loss happens in a virtual folder if virtual folder was opened at least in one panel but no active action was done by user before refresh happened?
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Post by *DrShark »

Why this topic moved to "Behaviour which will not be changed" subforum? TC option Configuration->Refresh->Auto-refresh when activating the program->No refresh for these drives: set to : should tell TC not to refresh virtual folders, yet still in described case TC re-reads and refreshes it. If it is not a bug, than what it is?
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Because it's not possible to reliably detect whether a virtual folder was changed or not. I can't just compare the ID lists because their content can change although the item itself doesn't.
Author of Total Commander
https://www.ghisler.com
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Post by *DrShark »

ghisler(Author) wrote:Because it's not possible to reliably detect whether a virtual folder was changed or not.
The option Configuration->Refresh->Auto-refresh when activating the program->No refresh for these drives: set to : (colon) is telling Total Commander NOT to refresh the virtual folders on TC window activation, no matter whether they was changed or not. But TC still refreshes virtual folder in such a case.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

It shouldn't do this with noreread=: - I will check it.
Author of Total Commander
https://www.ghisler.com
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Post by *DrShark »

history920.txt wrote:07.05.18 Fixed: Configuration - Options - Refresh - "No refresh for these drives" didn't work correctly for virtual folders: ':' should disable refresh, but instead, '\' was used (32/64)
It works now on \\Desktop\, but doesn't seem to work on \\Computer\: open \\Computer\, minimize TC [to tray]->connect usb drive->restore TC: \\Computer\ will be refreshed, new drive letter will appear.
history920.txt wrote:07.05.18 Fixed: Selection was always lost in virtual folders like the Desktop when switching away from TC and back, even when nothing changed (32/64)
On this change, which fixes not only deselection, but also a cursor jump issue, I wrote a feedback here: viewtopic.php?p=340824#340824
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

"Computer" is handled separately.
Author of Total Commander
https://www.ghisler.com
Post Reply