Active Background copy dialog: no focus on buttons in some cases (so most keys don't work)

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:

Active Background copy dialog: no focus on buttons in some cases (so most keys don't work)

Post by *DrShark »

There are some cases when Bacground copy progress dialog window is active but there is not even a single focused UI element on it, so there is no way to change the focus woth keyboard using Tab key, or even press again a key which was previously pressed with keyboard.

Case 1.
0. Make sure Total Commander is configured to be minimized to notification area (Configuration->Operation->["Main program" options group]->Move icon to system tray when mimimized).
1. Start Background copy (copy some big or many smaller files normally with F5, and in copy progress dialog press/click "Background" button).
2. Total Commander window should be still active, Press Alt+Space to call TC window system context menu, there choose Minimize.
Total Commander main window will disappear and a notification area TC icon will appear, while the Background copy progress winndow will become active. However, in this case it won't have any focused UI item, so pressing almost any key like Tab, Enter or Esc won't work, Windows will just make a beep sound on attemt to press them.

Case 2.
0. Make sure Total Commander is configured to be minimized to notification area (Configuration->Operation->["Main program" options group]->Move icon to system tray when mimimized).
1. Start Background copy (copy some big or many smaller files normally with F5, and in copy progress dialog press/click "Background" button).
2. Total Commander window should be still active, Press Win+D to show the Desktop.
Total Commander main window will disappear and a notification area TC icon will appear, and the Background copy progress winndow will be mimimized to a button on a Taskbar.
3. With Alt+Tab switch back to Background copy window. The window will be restored from Taskbar and will be active. The "Pause" button will be focused.
4. With Tab key switch the focus from "Pause" button to "Foreground" one.
5. Press Enter key: "Foreground" key will get a keypress, and the focus will go away from it to nowhere (since TC is minimized to tray, currently there won't be actual switch of main TC window to foreground - there is a feature request to make it happen in this case). Now the Background copy window is still active but there is no focus on its UI elements (as in step 2 of case 1).

Reproduced on Windows 7 32-bit with Classic theme in TC 10 final using both default/normal and dark modes.

In this situation when the Background copy window is active but there is no focus on its UI elements even explicit attempt re-switch to Background copy window with Alt+Tab is changing nothing. Though there is a way to return the focus with keyboard by making a switch from Background copy window (so it becomes inactive) e.g. to switch to other app or in Background copy dialog to press Alt+Space->Minimize, and then with Alt+Tab to switch back to Background copy with Alt+Tab - this way "Pause" button will get the focus again as expected.
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: 48012
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Active Background copy dialog: no focus on buttons in some cases (so most keys don't work)

Post by *ghisler(Author) »

Thanks for your report.
Case 1 seems to be a Windows bug - Windows normally sets the focus by itself on the first (or default) control, but this doesn't seem to happen here. After adding a SetFocus call in WM_ACTIVATE handler it seems to work.
In case 2, the minimized TC gets the focus - press Alt+F4 and it will warn about running background tasks. This can be fixed by restoring the minimized window when the user clicks on "Foreground".
Author of Total Commander
https://www.ghisler.com
Post Reply