[9.2b]Plugins install Window OnTop LOST

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

Moderators: white, Hacker, petermad, Stefan2

User avatar
thomasmolover
Member
Member
Posts: 160
Joined: 2016-12-12, 01:32 UTC

[9.2b]Plugins install Window OnTop LOST

Post by *thomasmolover »

when I install a plugins, like WLX, the setting order windows show, the display driver was auto updating bachground, and flash the screen. after the screen flash over, the TC plugins windows was lost, and I couldn't do anything with TC. I pressed alt-tab switch the windows several times, the plugins window come back :oops:
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Re: [9.2b]Plugins install Window OnTop LOST

Post by *DrShark »

thomasmolover wrote:when I install a plugins, like WLX, the setting order windows show
This is a modal window. Such behavior in a case you described is normal when modal application window is opened, I often get such a situation with e.g. internal "Synchronize directories" window.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
thomasmolover
Member
Member
Posts: 160
Joined: 2016-12-12, 01:32 UTC

Re: [9.2b]Plugins install Window OnTop LOST

Post by *thomasmolover »

DrShark wrote:
thomasmolover wrote:when I install a plugins, like WLX, the setting order windows show
This is a modal window. Such behavior in a case you described is normal when modal application window is opened, I often get such a situation with e.g. internal "Synchronize directories" window.
This should be an exclusive window, similar to the "Settings" screen. When this window is opened, the TC main window cannot be operated at the "bottom level"

The window you open should be similar to the background copy interface, independent of the TC main window, and you can switch between them.
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Post by *DrShark »

Both "Lister Plugins" window you mentioned in first post and "Synchronize directories" (called by cm_FileSync) windows are modal (before closing them, you can't activate a background main Total Commander window), but if such a modal window gets minimized, or covered by a window of other application, sometimes Windows then may return you to the unresponsive/invisible main Total Commander window, so additional actions (like pressing Alt+Tab many times, or a Task Manager may be required to restore the modal window.)
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
MarcinW
Power Member
Power Member
Posts: 852
Joined: 2012-01-23, 15:58 UTC
Location: Poland

Post by *MarcinW »

thomasmolover described some subtle problem, that appears sometimes for some unclear reason. I know it, because it sometimes appeared also in my own applications...

Let's experiment a bit first (tested with Windows 7 and older):

1) launch 64-bit TC
2) use "Configuration -> Options" menu, so main configuration window will be shown
3) choose "Plugins" and press any of the four "Configure" buttons, so plugin configuration window will be shown
4) now click somewhere on the main Configuration window, for example on its title bar - plugin configuration window's title bar will blink for a moment
5) close plugin configuration window, so you are back in the main configuration window
6) now click by mouse somewhere on the main TC window, for example on its title bar - main configuration window's title bar will blink for a moment

Now try the same with 32-bit TC - title bar will not blink. Why? Because 32-bit TC has been compiled by using some old version of Delphi IDE, and 64-bit TC has been compiled by using Lazarus IDE.


When compiled with Lazarus (64-bit TC), window hierarchy looks like:

Code: Select all

Main TC window
  |
  +------ Main configuration window
            |
            +------ Plugin configuration window
Here, every window is a parent for the next window, so the operating system will never allow to change their order on the screen - the last window is always on top, and no window will be placed below its parent, its grandparent, its grandgrandparent, etc.


When compiled with old Delphi (32-bit TC), window hierarchy looks like:

Code: Select all

Button on the taskbar (TApplication)
  |
  +------ Main TC window
  |
  +------ Main configuration window
  |
  +------ Plugin configuration window
Here, every window has the same parent, so every window can be placed on top. TC places Plugin configuration window on top, but from the operating system's point of view, every of these windows can be placed on top. And sometimes, for some unclear reason, some operating system's code changes order of the windows. And this is catastrophic for TC, because the active window is moved below some other TC window, and all other TC windows are disabled - i.e. ignore mouse and keyboard :(


Solution: Every next window should have the previous window as its parent, so the operating system will never allow to move it below its parents. Since Delphi 2006, an Application.ModalPopupMode property can be set to pmAuto during program initialization, and it is all that is needed to solve the problem. In older Delphi versions, workaround must be done manually.

I'll take a look at my old code and inform about possible solutions here in a next post.

Regards
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Sorry, I don't think that this can be avoided. TC probably gets a close request for the modal dialog.
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 »

No, no window is closed, by the operating system - for some unclear reason - reodrers TC windows. If the currently active configuration TC window is moved below a maximized main TC window, there is no much that the user can do...

This can be solved by setting parents properly, when creating TC windows.

The easiest solution is... to patch Delphi sources in two or three places. If you could send me Dialogs.pas and Forms.pas from Delphi 2 by email, I will try to fix them.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

TC doesn't use normal Delphi form creation here. The parent window handle is already set correctly.
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 »

Of course, parent window handle is set correctly, to Application.Handle - for all windows. This is the way, how old Delphi VCL library works.

To solve the problem, parent window handle should be set properly, to the handle of the real parent. This can be done by overriding two methods of the form: CreateParams and ShowModal.



See the example attached below. It creates three windows.

First, launch the example as it is: every window is a parent for the next window - exactly as it should be. Clicking on the parent window makes child window's title bar blinking. Application is protected from the problem described in the initial thomasmolover's post.

Then remove reference to the "Patch" unit from Unit1.pas, Unit2.pas and Unit3.pas and try again. This will reproduce the current TC behavior.



If you have your custom base class for all TC forms, it's enough to override CreateParams and ShowModal methods in this base class - in a similar way as it's in Patch.pas.

Code: Select all

MIME-Version: 1.0
Content-Type: application/octet-stream; name="test.zip"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="test.zip"

UEsDBBQAAgAIAAAAr0wBFpYBHAEAACoCAAAPAAAAR2V0TXlQYXJlbnQucGFznVGxboMwEN2R+AdL
HQAFoRQpCxFL0zbpEFKlkRhQVF3hnFgFE9mmLf362kATMlWql/Pdvffu+dxwpsgS1bp9BoFczW3L
thhXKCjkaJJGorQtQh5rUcmuTRueK1Zzkh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CCAzqvflAjJnmZzx1cZR61POZcYkwFGxroME3zoU1kl2lrAGLfRZaOcyANirAs3OVi6FU6hX
E/yoCC3/mXTkNJYDYbic1+46y9GWSH7vtbig5nnY9Fgw8alI2mAh/bEyPth2Blt/QHHjrCD3pzd4
Tl42h6/pz1vkw220Eni/Bkax5D8fBZ4bKyqTh5JMdXIyXX/Ubtc/xD3dVMJ5OPc5iaNvUEsBAhQA
FAACAAgAAACvTAEWlgEcAQAAKgIAAA8AAAAAAAAAAQAgAAAAAAAAAEdldE15UGFyZW50LnBhc1BL
AQIUABQAAgAIAAAAr0w6YxqRPgIAAHoGAAAJAAAAAAAAAAEAIAAAAEkBAABQYXRjaC5wYXNQSwEC
FAAUAAIACAAAAK9MgDa7nqcAAABUAQAADAAAAAAAAAABACAAAACuAwAAUHJvamVjdDEuZHByUEsB
AhQAFAACAAgAAACvTAZ7rb9xAQAAbAMAAAwAAAAAAAAAAAAgAAAAfwQAAFByb2plY3QxLnJlc1BL
AQIUABQAAgAIAAAAr0wQWghOFQEAAJcBAAAJAAAAAAAAAAAAIAAAABoGAABVbml0MS5kZm1QSwEC
FAAUAAIACAAAAK9MUIkE0wsBAAAcAgAACQAAAAAAAAABACAAAABWBwAAVW5pdDEucGFzUEsBAhQA
FAACAAgAAACvTKWSqoVWAQAAGAIAAAkAAAAAAAAAAAAgAAAAiAgAAFVuaXQyLmRmbVBLAQIUABQA
AgAIAAAAr0x5X/P3EwEAADQCAAAJAAAAAAAAAAEAIAAAAAUKAABVbml0Mi5wYXNQSwECFAAUAAIA
CAAAAK9MlGe2aBgBAACWAQAACQAAAAAAAAAAACAAAAA/CwAAVW5pdDMuZGZtUEsBAhQAFAACAAgA
AACvTIolYwrqAAAAlwEAAAkAAAAAAAAAAQAgAAAAfgwAAFVuaXQzLnBhc1BLBQYAAAAACgAKADIC
AACPDQAAAAA=
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 is elsewhere: TC already uses its own call to CreateWindowExW to create Unicode windows. It does pass the correct parent to it. However, the parent is 0 after creating resizable windows like the plugin configuration dialog, but it's correct for fixed size dialogs like "change attributes". Apparently one of the style flags is causing this.

It works with stlye=0x86C80000,
but not with style=0x6CF0000.

Edit: Looks like I have to set WS_POPUP to set the parent.
Author of Total Commander
https://www.ghisler.com
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

This should be fixed in beta 3, please test it! I'm setting WS_POPUP now for all resizable windows too.
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 »

I made some investigation with Microsoft Spy++ and 32-bit TC. I can confirm, that every TC window that I tested had its parent set properly.

But why don't TC windows blink, when clicking on windows's parent (in 32-bit TC - 64-bit TC works as expected)?


I created a test application, displaying a main window and a message box. Main window is set as the message box'es parent. Clicking on the main window makes message box blinking for a while - sniffed message box'es messages look like:

Code: Select all

<00128> 001901B0 S .WM_WINDOWPOSCHANGING lpwp:0012EB1C
<00129> 001901B0 R .WM_WINDOWPOSCHANGING lResult:00000000
<00130> 001901B0 S .WM_NCACTIVATE fActive:False
<00131> 001901B0 S ..WM_GETTEXT cchTextMax:510 lpszText:0012E218
<00132> 001901B0 R ..WM_GETTEXT cchCopied:26 lpszText:0012E218 ("b") [lResult:0000001A]
<00133> 001901B0 R .WM_NCACTIVATE fDeactivateOK:True [lResult:00000001]
<00134> 001901B0 P message:0x0118 [Unknown] wParam:0000FFF8 lParam:A008CB46
<00135> 001901B0 S WM_NCACTIVATE fActive:True
<00136> 001901B0 S .WM_GETTEXT cchTextMax:510 lpszText:0012E6F4
<00137> 001901B0 R .WM_GETTEXT cchCopied:26 lpszText:0012E6F4 ("b") [lResult:0000001A]
<00138> 001901B0 R WM_NCACTIVATE lResult:00000001
<00139> 001901B0 P message:0x0118 [Unknown] wParam:0000FFF8 lParam:A008CB46
<00140> 001901B0 S WM_NCACTIVATE fActive:False
<00141> 001901B0 S .WM_GETTEXT cchTextMax:510 lpszText:0012E6F4
<00142> 001901B0 R .WM_GETTEXT cchCopied:26 lpszText:0012E6F4 ("b") [lResult:0000001A]
<00143> 001901B0 R WM_NCACTIVATE fDeactivateOK:True [lResult:00000001]
<00144> 001901B0 P message:0x0118 [Unknown] wParam:0000FFF8 lParam:A008CB46
<00145> 001901B0 S WM_NCACTIVATE fActive:True
<00146> 001901B0 S .WM_GETTEXT cchTextMax:510 lpszText:0012E6F4
<00147> 001901B0 R .WM_GETTEXT cchCopied:26 lpszText:0012E6F4 ("b") [lResult:0000001A]
<00148> 001901B0 R WM_NCACTIVATE lResult:00000001
<00149> 001901B0 P message:0x0118 [Unknown] wParam:0000FFF8 lParam:A008CB46
<00150> 001901B0 S WM_NCACTIVATE fActive:False
<00151> 001901B0 S .WM_GETTEXT cchTextMax:510 lpszText:0012E6F4
<00152> 001901B0 R .WM_GETTEXT cchCopied:26 lpszText:0012E6F4 ("b") [lResult:0000001A]
<00153> 001901B0 R WM_NCACTIVATE fDeactivateOK:True [lResult:00000001]
<00154> 001901B0 P message:0x0118 [Unknown] wParam:0000FFF8 lParam:A008CB46
<00155> 001901B0 S WM_NCACTIVATE fActive:True
<00156> 001901B0 S .WM_GETTEXT cchTextMax:510 lpszText:0012E6F4
<00157> 001901B0 R .WM_GETTEXT cchCopied:26 lpszText:0012E6F4 ("b") [lResult:0000001A]
<00158> 001901B0 R WM_NCACTIVATE lResult:00000001
<00159> 001901B0 P message:0x0118 [Unknown] wParam:0000FFF8 lParam:A008CB46
<00160> 001901B0 S WM_NCACTIVATE fActive:True
<00161> 001901B0 S .WM_GETTEXT cchTextMax:510 lpszText:0012E6F4
<00162> 001901B0 R .WM_GETTEXT cchCopied:26 lpszText:0012E6F4 ("b") [lResult:0000001A]
<00163> 001901B0 R WM_NCACTIVATE lResult:00000001

Then I launched Help -> About Total Commander, which also displays a message box, and tried the same. Sniffed message box'es messages look like:

Code: Select all

<00182> 001201BE S .................................................WM_WINDOWPOSCHANGING lpwp:000CD0DC
<00183> 001201BE R .................................................WM_WINDOWPOSCHANGING lResult:00000000

Some notes:
- S means sent, P means posted, R means return from the call, dot . means that message handling is nested by 1 level, a lot of dots .................. means that message handling is very nested
- in both cases there is a WM_WINDOWPOSCHANGING message first - and in both cases lResult:00000000 is returned, which means, that application handled the message
- there is a series of 0x0118 messages in the first case (this is an undocumented WM_SYSTIMER message) - each of them initiates one title bar blink
- there are no 0x0118 messages in the second case (i.e. in TC)

Conclusion: it seems that 32-bit TC, in its WM_WINDOWPOSCHANGING handler, modifies WINDOWPOS record (passed as a parameter of the WM_WINDOWPOSCHANGING message) in such way, that blinking is disabled.

This doesn't seem to be either proper or intentional behavior. Could you look at this? Just look what is in the WINDOWPOS record before and after WM_WINDOWPOSCHANGING message handling. Then compare this with 64-bit TC.

Regards
User avatar
Dalai
Power Member
Power Member
Posts: 9364
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

2MarcinW
AFAIK Delphi applications don't support blinking the modal window when clicking any of their parents. This doesn't even work when an application is compiled with Delphi XE2. The reason is probably somewhere within the VCL. Yes, it's nice that other applications (including ones compiled by FPC) do that, but I guess that it's going to take a lot of digging through the Delphi (VCL) code to find something.

Regards
Dalai
#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
MarcinW
Power Member
Power Member
Posts: 852
Joined: 2012-01-23, 15:58 UTC
Location: Poland

Post by *MarcinW »

Yes, Delphi applications don't support blinking by default (compiled with old Delphi - at all). This is because of specific application window hierarchy - see my post above. In Delphi XE2, you can use "Application.ModalPopupMode := pmAuto" at the application startup to solve the problem.

But TC uses its own code to create windows (ghisler(Author) said "TC already uses its own call to CreateWindowExW to create Unicode windows" - see his post above). I verified, that TC window hierarchy is as it should be (with Microsoft Spy++ tool - see my last post), so blinking should work.

Conclusion: blinking doesn't work not due to some Delphi standard code, but due to some custom code, that interferes with the operating system.

Regards
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

I don't think that the blinking has anything to do with the problem described here. If anyone knows how to change that, please let me know. Do I need to react to WM_WINDOWPOSCHANGING in a special way? Or just call FlashWindow myself?
Author of Total Commander
https://www.ghisler.com
Post Reply