"Lister: view methods by file type" dialog can't be closed while other modal TC window is opened

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

Moderators: white, Hacker, petermad, Stefan2

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

"Lister: view methods by file type" dialog can't be closed while other modal TC window is opened

Post by *DrShark »

To reporoduce:
0. (optional) Start TC with clean ini.
1. Open some file with Lister by F3 or Alt+Shift+F3.
2. In Lister, open Options/Configure Lister->Multimedia, press the button "Define view method by file type...".
"Lister: view methods by file type" dialog will appear.
3. Switch to main Total Commander window, there open some internal modal window, like Find Files (by default with Alt+F7) or Muulti Rename Tool (by default using Ctrl+M).
4. Switch again to "Lister: view methods by file type" dialog window and try to close it by clicking [Cancel] or [x] buttons, or by pressing Esc or Alt+F4:
the dialog will still be opened.
5. If to close that other TC's modal window opened in step 3, the "Lister: view methods by file type" will also be closed.

Actually, the dialog with a title "Lister: view methods by file type" (and its subdialogs), which used in Lister, in TC is used in various places with other titles and some minor modifications, so this bug, it seems, could be triggered for them in a different ways, e.g.
1. Open Internal Associations, then click Add..., "Specify file type" subdialog will be opened.
2. Open "Lister: view methods by file type" dialog from Lister's configuration:
"Specify file type" dialog can't be closed while is "Lister: view methods by file type" opened.

Reproduced on: Windows 7 SP1 32bit, TC 10.00 pb1a.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
gdpr deleted 6
Power Member
Power Member
Posts: 872
Joined: 2013-09-04, 14:07 UTC

Re: "Lister: view methods by file type" dialog can't be closed while other modal TC window is opened

Post by *gdpr deleted 6 »

I can confirm on Win7 Pro x64.

And what i believe to be a very closely related issue is already present when only opening lister's configuration dialog without going into the "Define view method by file type..." dialog. I could observe this issue in both TC 9.51 and TC 10.00b1a.

In 32-bit version of TC, the OK/Cancel and [x] buttons of the "Configure lister" dialog will be blocked in the same manner as Dr. Shark described for the "Define view method by file type..." dialog.


However, in 64-bit version of TC, behavior is slightly different and peculiar, leading to a crash. Follow below steps exactly (i found when i even slightly deviated from or varied the order of these steps, the crash did not occur)

0. Make sure you started TC with a fresh INI with default values...
1. Open lister's "Configure lister" dialog, keep it open.
2. Go back to the main window of TC and open the "Find Files" (Alt+F7) dialog, keep it open.
3. Go back to lister and attempt to close the "Configure lister" dialog.
4. Click on either the OK or Cancel button. They don't work, no effect.
5. Click on the [x] button of the dialog. It closes the "Configure lister" dialog.
6. Close lister.
7. Close the "Find files" dialog.
8. Crash! Unhandled by TC's exception/crash handler, Windows' own crash handler / error reporting pops up with the following information:
WinErrorReporting wrote:Problem signature:
Problem Event Name: BEX64
Application Name: TOTALCMD64.EXE
Application Version: 10.0.0.0
Application Timestamp: 00000000
Fault Module Name: StackHash_351c
Fault Module Version: 0.0.0.0
Fault Module Timestamp: 00000000
Exception Offset: 0000000000000000
Exception Code: c0000005
Exception Data: 0000000000000008
OS Version: 6.1.7601.2.1.0.256.48
Locale ID: 2057
Additional Information 1: 351c
Additional Information 2: 351c8e05268c7be6cda6d946ed5cf02b
Additional Information 3: aaf9
Additional Information 4: aaf9bb229e19609ecb74d2940a50ff91
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: "Lister: view methods by file type" dialog can't be closed while other modal TC window is opened

Post by *ghisler(Author) »

I'm sorry but this cannot be fixed. The only way to avoid it would be to always use standalone Listers (start via /S=L parameter), but this is considerably slower than opening them internally. The downside is that you need to close the last opened popup window first.
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:

Re: "Lister: view methods by file type" dialog can't be closed while other modal TC window is opened

Post by *DrShark »

Is it possible to implement some feedback in this case so users would understand why the window can't be closed?
If possible, I suggest to implement it like this:
1. User opens TC's modal window "a".
2. User opens TC's modal window "b", and due to this "a" can't be closed while "b" is opened.
3. When user makes an attempt to close window "a", ignore "close window" action (so it won't be in a queue as an event after closing the window "b"), activate window "b", blink it with added a beep sound.
4. When user will close the window "b", switch focus to a window "a" so user can close it.

This behavior will be similar to Windows behavior when user tries to access the parent window while the modal child window is opened.
Last edited by DrShark on 2021-03-15, 09:53 UTC, edited 2 times in total.
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:

Re: "Lister: view methods by file type" dialog can't be closed while other modal TC window is opened

Post by *ghisler(Author) »

I will check it, but it will require a lot of changes, so don't expect it too soon.
Author of Total Commander
https://www.ghisler.com
gdpr deleted 6
Power Member
Power Member
Posts: 872
Joined: 2013-09-04, 14:07 UTC

Re: "Lister: view methods by file type" dialog can't be closed while other modal TC window is opened

Post by *gdpr deleted 6 »

32-bit version of TC 10.00b2 fixes the issue. Yay! :-)

64-bit TC 10.00b2 fixes the issue only partially. The "Cancel" button of the lister config dialog(s) will be blocked successfully, however it is still possible to close the dialogs via the [X] button in the top-right dialog corner or via selecting the context menu entry "Close window" on the lister icon in the task bar, and thus cause the subsequent crash. While TC fails to block closing the lister dialogs when closed via [X] or task bar icon, it still shows the warning dialog and brings the blocking dialog (such as Find files or MRT dialog) to the front.

Observed using a fresh wincmd.ini on Win7 x64 Pro.
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Re: "Lister: view methods by file type" dialog can't be closed while other modal TC window is opened

Post by *DrShark »

history1000.txt wrote:17.03.21 Added: Show a warning when the user tries to close a modal dialog which cannot be closed, e.g. when you open Total Commander, then Lister, then Lister configuration, then Total Commander configuration, then try to close Lister configuration first (32/64)
I can confirm TC 10.00 PB2 now shows a warning in this case:

Code: Select all

---------------------------
WARNING!
---------------------------
Cannot close this dialog, because another dialog was opened AFTER this dialog in another Total Commander window. Please close that other dialog first!
---------------------------
ОК   
---------------------------
Are there plans to improve this change by indication of the particular window (e.g. by making it being focused and maybe making it blinking after use presses OK in above warning) which prevents the closing of current one?
It's possible e.g. to open TC, then many Lister windows, then modal dialogs in some Lister windows, then a modal dialog in TC, then again modal dialogs in some other Lister windows, in random order, so when user tries then to close some opened modal dialog which can't be closed, it would be good to switch as soon as possible to the dialog which must be closed first.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
gdpr deleted 6
Power Member
Power Member
Posts: 872
Joined: 2013-09-04, 14:07 UTC

Re: "Lister: view methods by file type" dialog can't be closed while other modal TC window is opened

Post by *gdpr deleted 6 »

DrShark wrote: 2021-03-19, 13:06 UTC Are there plans to improve this change by indication of the particular window (e.g. by making it being focused and maybe making it blinking after use presses OK in above warning) which prevents the closing of current one?
During my tests, TC 10.00b2 (both 32-bit and 64-bit ) already does this. I have no idea why it doesn't do it on your machine, though...
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Re: "Lister: view methods by file type" dialog can't be closed while other modal TC window is opened

Post by *DrShark »

elgonzo wrote: 2021-03-19, 13:08 UTC
DrShark wrote: 2021-03-19, 13:06 UTCmaking it being focused [...] after use presses OK in above warning) which prevents the closing of current one?
During my tests, TC 10.00b2 (both 32-bit and 64-bit ) already does this.
You are right, it seems in some cases I just didn't close the warning - its message doesn't tell to do this to make problem windows focused. I think, a warning text might be improved a bit by adding a note about this, like "(switch there by closing this warning)" or "(close this warning to switch there)":

Code: Select all

---------------------------
WARNING!
---------------------------
Cannot close this dialog, because another dialog was opened AFTER this dialog in another Total Commander window. Please close that other dialog first (switch there by closing this warning)!
---------------------------
ОК   
---------------------------
Last edited by DrShark on 2021-03-19, 13:40 UTC, edited 3 times in total.
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:

Re: "Lister: view methods by file type" dialog can't be closed while other modal TC window is opened

Post by *ghisler(Author) »

How about "Click OK to switch to the dialog?"
Author of Total Commander
https://www.ghisler.com
gdpr deleted 6
Power Member
Power Member
Posts: 872
Joined: 2013-09-04, 14:07 UTC

Re: "Lister: view methods by file type" dialog can't be closed while other modal TC window is opened

Post by *gdpr deleted 6 »

2ghisler(Author)
Sounds fine!
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Re: "Lister: view methods by file type" dialog can't be closed while other modal TC window is opened

Post by *DrShark »

I also thought about mentioning the "OK" button at first, however that warning can be closed not only with OK/Enter, but also with [x]/Alt+F4/Esc, so there is a wise choice of ways to get it closed...
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
Dalai
Power Member
Power Member
Posts: 9364
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: "Lister: view methods by file type" dialog can't be closed while other modal TC window is opened

Post by *Dalai »

Maybe "Dismiss/close this window/warning to switch to that dialog" or similar.
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Re: "Lister: view methods by file type" dialog can't be closed while other modal TC window is opened

Post by *DrShark »

Dalai wrote: 2021-03-19, 18:19 UTC Maybe "Dismiss/close this window/warning to switch to that dialog" or similar.
And regarding the "dialog" word. In the note I suggested initially ("close this warning to switch there") I intentionally replaced "dialog" with "there", because, even though almost all modal windows probably could be called dialog windows ("dialogs"), the "dialog" word is used mainly when talking about something like OK/Cancel message box, and for windows like Find Files or Multi Rename Tool more often used just the word "window". So when the switch happens from the warning to the dialog window like Find Files or MRT, there maybe some doubt about whether that window is indeed a dialog which must be closed...
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
Post Reply