[TC10.52rc4] focus on 0 width panel

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

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
white
Power Member
Power Member
Posts: 4617
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

[TC10.52rc4] focus on 0 width panel

Post by *white »

When the panel width is very small or zero, it is good that the panel can no longer receive focus. Because otherwise you might accidentally rename files (or worse) because you don't see what you are doing.

For testing the things below I used default options (clean ini).

When resizing a panel by dragging the window divider with the mouse

32-bit TC:
It seems that when the space within the active panel becomes 7 pixels wide or less, the focus is automatically moved to the other side. If the width is 5-7 pixels you can still move focus back to the very small panel. If the width is 4 pixels or less the panel can no longer receive focus.

64-bit TC:
It seems that when the active panel width is 0.9% or less, the focus is automatically moved to the other side. If the width is 0.5-0.9% you can still move focus back to the very small panel. If the width is 0.4% or less the panel can no longer receive focus.

32-bit TC seems to work with pixels while 64-bit TC seems to work with percentages.
With 64-bit TC it can happen (with a small window) that a panel is hardly visible anymore and can still receive focus.

When resizing a panel by using a command or startup with very small active panel size

The focus shift to the other panel does not happen when you resize the active panel to a very small size (for example 0) using the cm_50percent command or when the active panel has a very small size at startup.

For example when using the command: cm_50Percent -100 (active panel size becomes 0)
Or suppose you resized the panel to 70,2% by dragging the mouse and then used a button with command "cm_50Percent -10" seven times.
Or click right panel, execute cm_100Percent, save settings and restart TC.

As explained at the beginning, it is not good that that a panel with width 0 or near 0 can receive focus.

For 32-bit TC you get strange behavior when you resize the active panel to a very small size using a command and than make the panel larger again.
For example:
  • Select a file
  • Do this command: cm_50Percent -100,cm_50Percent
  • Press Alt+Enter (Properties) and press Esc (close Properties)
  • Now the cursor in the panel is gone and focus seems to be somewhere else.
Another example with 32-bit TC:
  • Put focus on left panel
  • Select a file
  • Do this command: cm_50Percent -100,cm_50Percent
  • Press the Tab key
  • Nothing happens, you have to press Tab again
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48077
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC10.52rc4] focus on 0 width panel

Post by *ghisler(Author) »

The problem here is that the command
cm_50Percent -100
doesn't move the cursor to the other panel, because it would interfere with other commands when the active panel suddenly changed. I will not change that now, it could cause a lot of troubles. But I can programmatically set the focus to the active panel when the width is big enough.
Author of Total Commander
https://www.ghisler.com
User avatar
white
Power Member
Power Member
Posts: 4617
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: [TC10.52rc4] focus on 0 width panel

Post by *white »

It can cause a lot of trouble now.

The problems you are talking about can be avoided by not changing the focus after a specific command has been executed, but just before the user regains control of the program. So after starting the program and after executing a (combined) command has been completed.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48077
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC10.52rc4] focus on 0 width panel

Post by *ghisler(Author) »

Sorry, that's not possible with the current implementation. But who uses cm_50Percent -100 anyway? Isn't that a bit too constructed? Maybe I should forbid parameter -100?
Author of Total Commander
https://www.ghisler.com
User avatar
white
Power Member
Power Member
Posts: 4617
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: [TC10.52rc4] focus on 0 width panel

Post by *white »

ghisler(Author) wrote: 2022-10-20, 09:06 UTC But who uses cm_50Percent -100 anyway? Isn't that a bit too constructed?
No, it was just an example. Any negative number can result in the active panel size being 0 or near 0. For example cm_50Percent -50 wil result in 0 sized panel if the divider was at 50% or less. You could also have 2 buttons with commands "cm_50Percent 10" and "cm_50Percent -10" to gradually increase or decrease size. If you would click the button with command "cm_50Percent -10" a number of times, the panel size would also reach zero.

Besides that, there are other ways that results in an active panel size of 0 or near 0. For example: click right panel, execute cm_100percent, save settings, close TC, open TC again later. Or by using "cm_50Percent <positive number>" and then the cm_FocusRight command.

The command "cm_50Percent -100,cm_50Percent" that I used to show the problems with 32-bit TC is also just an example.
User avatar
white
Power Member
Power Member
Posts: 4617
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: [TC10.52rc4] focus on 0 width panel

Post by *white »

HISTORY.TXT wrote: 19.10.22 Fixed: Set focus manually on active panel after resizing it to 0 width with cm_50Percent -100 and back to visible width (32/64)
Tested using TC 10.52rc5 32-bit. Fixed when resizing back to visible width using cm_50Percent or cm_100Percent command. Not fixed when manually resizing back to visible width (by dragging the divider with the mouse).
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48077
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC10.52rc4] focus on 0 width panel

Post by *ghisler(Author) »

Edit: I was able to reproduce it now in the 32-bit version only.
Author of Total Commander
https://www.ghisler.com
User avatar
white
Power Member
Power Member
Posts: 4617
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: [TC10.52rc4] focus on 0 width panel

Post by *white »

I did make clear form the beginning that this problem was for 32-bit only.
white wrote: 2022-10-19, 00:08 UTC For 32-bit TC you get strange behavior when you resize the active panel to a very small size using a command and than make the panel larger again.
white wrote: 2022-10-20, 11:39 UTC The command "cm_50Percent -100,cm_50Percent" that I used to show the problems with 32-bit TC is also just an example.
white wrote: 2022-10-21, 14:16 UTC Tested using TC 10.52rc5 32-bit.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48077
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC10.52rc4] focus on 0 width panel

Post by *ghisler(Author) »

I'm only setting the cursor on the window in cm_50percent and cm_10percent now, not when resizing manually.
Author of Total Commander
https://www.ghisler.com
User avatar
white
Power Member
Power Member
Posts: 4617
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: [TC10.52rc4] focus on 0 width panel

Post by *white »

2ghisler(Author)
That's what I said.
white wrote: 2022-10-21, 14:16 UTC Not fixed when manually resizing back to visible width (by dragging the divider with the mouse).
User avatar
white
Power Member
Power Member
Posts: 4617
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: [TC10.52rc4] focus on 0 width panel

Post by *white »

2ghisler(Author)
You didn't give me the 32-bit version of TC 10.52rc5a, so I cannot test this.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48077
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC10.52rc4] focus on 0 width panel

Post by *ghisler(Author) »

Sorry, I have sent it now.
Author of Total Commander
https://www.ghisler.com
User avatar
white
Power Member
Power Member
Posts: 4617
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: [TC10.52rc4] focus on 0 width panel

Post by *white »

white wrote: 2022-10-21, 14:16 UTC
HISTORY.TXT wrote: 19.10.22 Fixed: Set focus manually on active panel after resizing it to 0 width with cm_50Percent -100 and back to visible width (32/64)
Tested using TC 10.52rc5 32-bit. Fixed when resizing back to visible width using cm_50Percent or cm_100Percent command. Not fixed when manually resizing back to visible width (by dragging the divider with the mouse).
Tested OK using TC 10.52rc5a 32-bit. This is now also fixed when manually resizing back to visible width.

The version number of TC 10.52rc5a 32-bit is not adjusted, it still reads 10.52RC5.
Post Reply