Synchronize Dirs - Compare: Context menu entry "delete" for a file is (sometimes) greyed out

Bug reports will be moved here when the described bug has been fixed

Moderators: white, Hacker, petermad, Stefan2

HuSc
Junior Member
Junior Member
Posts: 25
Joined: 2014-03-10, 15:55 UTC

Re: Synchronize Dirs - Compare: Context menu entry "delete" for a file is (sometimes) greyed out

Post by *HuSc »

@petermad: Confirmed! I checked and it works in 32bit TC.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Synchronize Dirs - Compare: Context menu entry "delete" for a file is (sometimes) greyed out

Post by *ghisler(Author) »

I don't see any difference at all between 32-bit and 64-bit, they behave exactly the same.

Maybe you right clicked below the last item in 64-bit? Then the item doesn't get selected, and since nothing is selected, no delete option gets enabled.
Author of Total Commander
https://www.ghisler.com
HuSc
Junior Member
Junior Member
Posts: 25
Joined: 2014-03-10, 15:55 UTC

Re: Synchronize Dirs - Compare: Context menu entry "delete" for a file is (sometimes) greyed out

Post by *HuSc »

Nope, I right click directly on the file.


This effect occurs only with the *last* file in a result list (on right side and on left side)!

Imagine 3 different files listed for the right side:
- Toggle Green Arrow or Blue Arrow icon OFF and ON again.
- Right click directly onto a File:
-- File1 and File2 immediately show "Delete" active. Regardless how often I toggle the green/blue arrow.
-- But File3 has "Delete" greyed out, until I right click again directly onto that 3rd file!
It seems as the first right click gets ignored on that last entry.

PS, I just noticed following:
Imagine 3 different files listed for the right side:
- Toggle Green Arrow or Blue Arrow icon OFF and ON again.
- Right click directly onto the last file on the right side: "Delete" is inactive!
- Right click directly onto one of the upper files on the right side: "Delete" is active there!
- Right click directly onto the last/bottom File on the right side: "Delete" is inactive!
- Right click again directly onto that 3rd file and "Delete" is active.
User avatar
petermad
Power Member
Power Member
Posts: 14809
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Synchronize Dirs - Compare: Context menu entry "delete" for a file is (sometimes) greyed out

Post by *petermad »

2ghisler(Author)

It is amazing that you cannot reproduce any of this, by doing what I described here: viewtopic.php?p=442812#p442812

I can reproduce it with a clean ini file under both Windows 7 and 10 in 64bit TC - have you really followed what I wrote step by step?

I have uploaded an archive with two directories you can test with: https://tcmd.madsenworld.dk/syncDeleteTest.zip - please try with them.

You must have the test1 dir in the left side of the synchronization, if you follow my description.

It is not that it does not happen with test2 in the left side, but the sequence of clicks are different - for example for the test in Normal mode step 4 has to be: "4 Right-click on the green single file in the left side" - apparently it has to be the file nearest to the bottom that has to be right-clicked to see the bug - the "last" file as HuSc describes it.

I have made two new videos that shows exactly wat is described in viewtopic.php?p=442812#p442812 :
https://tcmd.madsenworld.dk/syncdeletenormal.mp4
https://tcmd.madsenworld.dk/syncdeletedark.mp4

Notice, in the videos left-click is indicated with a red circle and right-click is indicated with a blue circle. I close the context menu with Escape.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Synchronize Dirs - Compare: Context menu entry "delete" for a file is (sometimes) greyed out

Post by *ghisler(Author) »

2petermad
Thanks for the test file, I can reproduce it immediately with your file. And I found something strange:
When I follow the documentation of LB_SETSEL and set LPARAM to -1 to clear the selection, then the error occurs in 64-bit (LPARAM is 64_bit). But when I set it to 0xFFFFFFFF (32-bit -1), then the error doesn't occur.
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 14809
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Synchronize Dirs - Compare: Context menu entry "delete" for a file is (sometimes) greyed out

Post by *petermad »

Moderator message from: petermad » 2023-10-16, 14:33 UTC

Since the author can now reprodce the bug I have moved it back to "TC11.x bug reports (English)" from "TC Behaviour which will not be changed"
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
HuSc
Junior Member
Junior Member
Posts: 25
Joined: 2014-03-10, 15:55 UTC

Re: Synchronize Dirs - Compare: Context menu entry "delete" for a file is (sometimes) greyed out

Post by *HuSc »

@petermad: Many thanks for your efforts!

@ghisler: Glad to read that you could reproduce this effect now.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Synchronize Dirs - Compare: Context menu entry "delete" for a file is (sometimes) greyed out

Post by *ghisler(Author) »

Could you please test this with RC3? Maybe there are still some cases I missed...
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 14809
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Synchronize Dirs - Compare: Context menu entry "delete" for a file is (sometimes) greyed out

Post by *petermad »

2ghisler(Author)
I didn't see anything in the history.txt about this for RC3, so I assumed that it hadn't been fixed yet.

But I still se the same problems in RC3 as I described here: viewtopic.php?p=442812#p442812

I can add, that if I do the "Normal mode" test as described - but do it in Dark mode, then in step 5 I see BOTH delete items ENabled, as opposed to Normal mode where they are both DISabled.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
HuSc
Junior Member
Junior Member
Posts: 25
Joined: 2014-03-10, 15:55 UTC

Re: Synchronize Dirs - Compare: Context menu entry "delete" for a file is (sometimes) greyed out

Post by *HuSc »

Like petermad, I didn't expect a possible fix in RC3 because of the history.txt.

I still observe this bug on my configuration (TC11.02-RC3 64bit, Win7-64bit), whereas I didn't test in Dark Mode.

My test workflow:
- Create two folders on a local drive.
- Copy 1 text file into the 2nd folder.
- Open the empty folder in left panel.
- Open the folder with the single file in right panel.
- Perform a Sync - Compare with all 4 "Show:" icons ON.
- RMB on the found single right side file: "Delete" as active.
- Now toggle e.g. green arrow to OFF. (**)
- RMB click on the single right side file: "Delete" as greyed out!
- Apply a 2nd RMB click on the single right side file: "Delete" as now active.
- Now toggle e.g. "equal" button to OFF. (**)
- RMB click on the single right side file: "Delete" as greyed out!
- Apply a 2nd RMB click on the single right side file: "Delete" as now active.

PS1: Having multiple found files on the right side: This effect occurs only on the last/lowest file.

(**) I just noticed that this effect will occur also if one toggles the "equal" or "inequal" button, not only the arrow buttons.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Synchronize Dirs - Compare: Context menu entry "delete" for a file is (sometimes) greyed out

Post by *ghisler(Author) »

Well, I wasn't sure that the fix worked, so I didn't put it in the history. Apparently it didn't catch all cases (the right click on the last item returns the correct result now).

I did some more checks and found that the problem is actually in the Lazarus library for the listbox control. It has this strange note:

Code: Select all

  // if we're handling a WM_DRAWITEM, then LB_GETSEL is not reliable, check stored info
But in the special case of right clicking, the state stored in WM_DRAWITEM is out of date, because the item is only drawn after the menu is opened. I will call LB_GETSEL directly and bypass the Lazarus code, this seems to fix it.
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 14809
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Synchronize Dirs - Compare: Context menu entry "delete" for a file is (sometimes) greyed out

Post by *petermad »

ghisler wrote:(the right click on the last item returns the correct result now).
Not here.

Let's hope that bypassing the Lazarus code fixes it.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
HuSc
Junior Member
Junior Member
Posts: 25
Joined: 2014-03-10, 15:55 UTC

Re: Synchronize Dirs - Compare: Context menu entry "delete" for a file is (sometimes) greyed out

Post by *HuSc »

@ghisler: Thanks for checking and for your analysis.
Let's hope that bypassing the Lazarus code fixes it.
Dito.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Synchronize Dirs - Compare: Context menu entry "delete" for a file is (sometimes) greyed out

Post by *ghisler(Author) »

This should be fixed in RC4 64-bit, please check it!
Author of Total Commander
https://www.ghisler.com
HuSc
Junior Member
Junior Member
Posts: 25
Joined: 2014-03-10, 15:55 UTC

Re: Synchronize Dirs - Compare: Context menu entry "delete" for a file is (sometimes) greyed out

Post by *HuSc »

My use case problem is solved with RC4! The "Delete" is now active for the last/bottom file, after if toggle the "Show:" buttons. Works fine now. (I tested in both panels, yet not in Dark Mode.)

Many thanks!
Post Reply