Error sound after right click drive button

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

Moderators: white, Hacker, petermad, Stefan2

User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

It seems to be a specific XP behaviour
Well, as I wrote, I hear it without exception under Windows 7 and 8.1 - and occasionally under Windows 10
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.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
MarcinW
Power Member
Power Member
Posts: 852
Joined: 2012-01-23, 15:58 UTC
Location: Poland

Post by *MarcinW »

@ghisler(Author)

Could you please test, if this code solves the problem - and still works properly with cm_* commands - with Lazarus?

Code: Select all

if ActivePopupMenu <> nil then begin 
    MessageBeep(mb_iconexclamation); 
    exit; 
  end;
If so, there is also a possible solution for Delphi.
User avatar
Usher
Power Member
Power Member
Posts: 1675
Joined: 2011-03-11, 10:11 UTC

Post by *Usher »

When MS GUI devs introduced context menu under right click, they decided that there should be only ONE context menu open.
So when you right click another place, the system always closes already opened context menu and opens a new one in the new place.
You don't have two context menus open at a time. You don't need to close any context menu if you want to do anything else (f.e. open another context menu in a different context) - there is even NO button to close context menu and there is NO warning/error sound when you right click many times one by one (if there is no modal windows open).
Andrzej P. Wozniak
Polish subforum moderator
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

The problem isn't the opening of multiple context menus - Windows does prevent that. The problem is with internal processing when the user calls multiple context menu functions at once. Therefore I will keep the error beep in place.
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 »

2ghisler(Author)
DrShark wrote:... I noticed a difference when entering "System Volume Information" in c:\ in file panel (by mouse left doubleclick or keyboard Enter key) and by executing
cd "c:\System Volume Information"
from TC's command line: in second case there is no "Critical stop" sound after pressing OK button or Esc key in error dialog.
Can you please comment the reason of that behavior?
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) »

Hmm, no idea - the entered path gets a "cd" in front and is sent to the same function as the command line.
Author of Total Commander
https://www.ghisler.com
User avatar
MarcinW
Power Member
Power Member
Posts: 852
Joined: 2012-01-23, 15:58 UTC
Location: Poland

Post by *MarcinW »

@ghisler(Author): I can see two solutions for the original problem described in this topic.


1) Instead of using ShowRightclickMenuActive variable, just use ActivePopupMenu <> nil clause:

Code: Select all

if ActivePopupMenu <> nil then begin 
    MessageBeep(mb_iconexclamation); 
    exit; 
  end;
2) If, for some reason, the ShowRightclickMenuActive variable cannot be replaced in this way, beeps can still be limited to situations, when a popup menu is being displayed:

Code: Select all

if ShowRightclickMenuActive then begin
    if ActivePopupMenu <> nil then // ADDED HERE
      MessageBeep(mb_iconexclamation); 
    exit; 
  end;
If you could tell me if this solves the problem in Lazarus, I could post a similar solution for Delphi.

Regards
User avatar
Usher
Power Member
Power Member
Posts: 1675
Joined: 2011-03-11, 10:11 UTC

Post by *Usher »

ghisler(Author) wrote:The problem is with internal processing when the user calls multiple context menu functions at once.
If it's some problem with races, you can add delay when processing right clicks, as it is for right click on file list.

You have already stated, that there is NO system error when using double right click or double click twice, so error sound is misleading for common users (what app gives error?) and annoying for all users (the second right click is the right one, intended by user, <pun also intended>).
Andrzej P. Wozniak
Polish subforum moderator
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Unfortunately I cannot tell whether the user right clicked again on purpose, or whether the right click notification was sent twice due to some error. Therefore I prefer to keep it as it is for now.
Author of Total Commander
https://www.ghisler.com
User avatar
Usher
Power Member
Power Member
Posts: 1675
Joined: 2011-03-11, 10:11 UTC

Post by *Usher »

Right clicking many times one by one is definitely NOT an error. It's a NORMAL way to learn program features.

And in a common use right clicking twice is NOT an error as well, but it may be a mistake. In such cases the first right click usually misses intended target in a hurry or because of dirty mousepad, so the second right click is done on purpose to finish intended actions.
Andrzej P. Wozniak
Polish subforum moderator
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

So what do you expect me to do? Either not play any error sound at all, and the user wonders why the menu doesn't open. Or play an error sound, and it also gets played when there isn't an error? These are the two only options.
Author of Total Commander
https://www.ghisler.com
User avatar
Usher
Power Member
Power Member
Posts: 1675
Joined: 2011-03-11, 10:11 UTC

Post by *Usher »

ghisler(Author) wrote: Either not play any error sound at all, and the user wonders why the menu doesn't open.
But the context menu DOES open, in all the cases and at the right place, no matter - intended or not. NO error sound is nedeed in any case.
ghisler(Author) wrote:Or play an error sound, and it also gets played when there isn't an error? These are the two only options.
Mistake IS NOT an error. Where do you see (not hear) a real error?
Andrzej P. Wozniak
Polish subforum moderator
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

OK, I removed the MessageBeep call, and - surprise - it still beeps! It was actually something completely different: The previous context menu was returning 0 as selected item, and TC beeped to signal an error. I will fix it.
Author of Total Commander
https://www.ghisler.com
User avatar
Usher
Power Member
Power Member
Posts: 1675
Joined: 2011-03-11, 10:11 UTC

Post by *Usher »

Many thanks for your work.
Andrzej P. Wozniak
Polish subforum moderator
User avatar
Usher
Power Member
Power Member
Posts: 1675
Joined: 2011-03-11, 10:11 UTC

Post by *Usher »

Fixed in TC920rc2. Thanks once again.
Andrzej P. Wozniak
Polish subforum moderator
Post Reply