[9.2b]Plugins install Window OnTop LOST

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

Moderators: Hacker, Stefan2, white, sheep

User avatar
MarcinW
Power Member
Power Member
Posts: 852
Joined: 2012-01-23, 15:58 UTC
Location: Poland

Post by *MarcinW » 2018-05-18, 10:25 UTC

No, you don't need to do nothing! Blinking is the standard operating system's behavior! The problem is that 32-bit TC overrides this standard behavior somehow - I suppose it's not intentional.

I'll make some experiment and let you know here.

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

Post by *ghisler(Author) » 2018-05-18, 10:32 UTC

Well, I don't override it, it's probably somewhere deep in the Delphi libraries.
Author of Total Commander
http://www.ghisler.com

User avatar
MarcinW
Power Member
Power Member
Posts: 852
Joined: 2012-01-23, 15:58 UTC
Location: Poland

Post by *MarcinW » 2018-05-22, 10:18 UTC

I think it's rather not a Delphi problem, since the example pasted above (test.zip) works properly.

I need few more days to investigate this.

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

Post by *ghisler(Author) » 2018-05-22, 14:33 UTC

Unfortunately I couldn't find the reason. WM_WINDOWPOSCHANGING doesn't seem to be the problem - I do get this message when I click outside, but I don't get a beep, whether I return 1 or 0.

But this isn't the original problem here - I think that the original problem was solved?
Author of Total Commander
http://www.ghisler.com

User avatar
MarcinW
Power Member
Power Member
Posts: 852
Joined: 2012-01-23, 15:58 UTC
Location: Poland

Post by *MarcinW » 2018-05-22, 23:08 UTC

I found the reason.

It looks like a missing call to DefWindowProcA / DefWindowProcW for WM_SETCURSOR messages - at least when SmallInt(lParam) = HTERROR.

All 32-bit TC windows suffer from this problem.


Regards

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

Post by *ghisler(Author) » 2018-05-23, 15:03 UTC

Nice find, that seems to fix it, thanks!
Author of Total Commander
http://www.ghisler.com

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

Post by *ghisler(Author) » 2018-05-23, 15:38 UTC

This should be fixed in Total Commander 9.20 beta 4, please check!
Author of Total Commander
http://www.ghisler.com

User avatar
MarcinW
Power Member
Power Member
Posts: 852
Joined: 2012-01-23, 15:58 UTC
Location: Poland

Post by *MarcinW » 2018-05-25, 08:11 UTC

Now we can see that your patch for the main TC window works properly :)

Other TC windows still suffer from improper WM_SETCURSOR handling. For example:

A) Lister:
- press F3 on any file
- search for some text that can't be found, so you get a message box
- now click on the Lister window - message box doesn't blink - this means improper WM_SETCURSOR handling in Lister widow

B) Configuration window:
- choose "Configuration -> Options", so you get configuration window
- select "Font" in the left panel and press any of the "Change font" buttons, so you get a font selection dialog
- now click on the main TC window - font selection dialog blinks - this means proper WM_SETCURSOR handling in main TC window
- now click on the configuration window - font selection dialog doesn't blink - this means improper WM_SETCURSOR handling in configuration window

C) "Change attributes" window, "Find files" window, "Multi-rename tool" window also have similar problems as in B)

Solution: patch all your remaining WM_SETCURSOR handlers in the same way, as main TC window.




ghisler(Author) wrote:I think that the original problem was solved?
I just found a window with its parent improperly set (i.e. to TApplication instead of main TC window) - this is the nag screen ("Press 1/2/3") - both in 32-bit and 64-bit TC.

If you could implement WM_SETCURSOR fix in all the remaining windows, it will be much easier to test this - just by clicking, not by using tools like Microsoft Spy++.

User avatar
MarcinW
Power Member
Power Member
Posts: 852
Joined: 2012-01-23, 15:58 UTC
Location: Poland

Post by *MarcinW » 2018-05-25, 08:19 UTC

History.txt wrote:16.05.18 Fixed: Add flag WS_POPUP for all resizable dialog boxes, otherwise GetParent() would return 0 (32/64)
Just one question to be sure, that anything has been overlooked: why is the GetParent() call needed for WS_POPUP windows?

GetParent(WndHandle) only works when called on WS_CHILD windows (like button, checkbox, etc. - which move along with their parents).

To get parent of some stand-alone window (i.e. window having the title bar), GetWindow(WndHandle, GW_OWNER) must be called.

Regards

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

Post by *ghisler(Author) » 2018-05-25, 09:12 UTC

Sorry, I don't have the time to manually check all windows. I will add it for the nag screen as reported.
Author of Total Commander
http://www.ghisler.com

User avatar
MarcinW
Power Member
Power Member
Posts: 852
Joined: 2012-01-23, 15:58 UTC
Location: Poland

Post by *MarcinW » 2018-05-25, 10:35 UTC

I think I was misunderstood.

Checking manually for parents of all windows would be, of course, highly time-consuming.

I was talking about WM_SETCURSOR handlers (i.e. adding DefWindowProcA/W calls for them). Just search for "WM_SETCURSOR" string in your code - you probably share the same code for many window classes, so there are probably only two or three places with WM_SETCURSOR handlers, that need to be fixed.

Regards

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

Post by *DrShark » 2018-05-29, 11:17 UTC

It seems the behavior of Sync Dirs window I mentioned above is actually a bit different:
if to use Compare in Synchronize tool on some deel-level tree and to minimize and then restore window, Sync window may hang, and following minimize-restore tries may get main Total Commander window restored, and Sync Dirs window will be on top it, but not in restored state: it will be just a small window header (title bar) near Windows Start menu button, screenshot:
http://c1.staticflickr.com/1/894/42377548042_edf06323e0_b.jpg
It's possible to restore Sync Dirs window manually using a context menu of that window header/title.

However, I have a question about such situation: is it possible for TC to make Windows to restore SyncDirs window in such a case, or at least to place that header of SyncDirs window not in a left corner near Start button, but in a different place (centered / bottom centered)?
Last edited by DrShark on 2018-05-31, 08:08 UTC, edited 1 time in total.
Android 4.3.1 no root, kernel 08.09.2016; Vista Home Premium SP2 rus 32 bit
TC #149847 Personal licence

Cuz we're all in this together, We're here to make it right

User avatar
MarcinW
Power Member
Power Member
Posts: 852
Joined: 2012-01-23, 15:58 UTC
Location: Poland

Post by *MarcinW » 2018-05-29, 13:53 UTC

@DrShark:

The behavior that you described looks like due to unresponsive application (in this case: TC). When a thread, that created the window (in this case: sync tool window), doesn't read messages from the operating system for 5 seconds or longer, operating system assumes that the application is unresponsive (hung).

Under normal circumstances, the application itself is responsible for painting its own windows (by reading from the operating system - and handling - messages like WM_PAINT). In case of hung application, the operating system starts to paint the window - but only as a "ghost" window, having only a title bar, with empty window area. When the application starts reading messages from the operating system again, it repaints the window and everything starts to work as usual.

Side note: calling SendMessageTimeout API with a non-zero timeout value and SMTO_ABORTIFHUNG flag prevents our application from hanging, when the destination window's thread is hung.



Remedy: application should process messages at least every 5 seconds. In TC, this could be done by calling:

Code: Select all

Application.ProcessMessages
after processing every file. But I suppose, that TC already does this - and TC was hung just due to long-lasting disk operations.



Conclusion: The described behavior is normal and desired - and not connected in any way with the original problem, described in this thread. The only thing that can be potentially improved, is processing messages by TC after each synchronized file - if not already implemented.

Regards

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

Post by *ghisler(Author) » 2018-05-30, 16:55 UTC

The set_cursor problem reported by MarcinW should be fixed. Please report when you find windows where it doesn't blink.

I couldn't reproduce the problem by DrShark, it seems to be completely unrelated.
Author of Total Commander
http://www.ghisler.com

User avatar
MarcinW
Power Member
Power Member
Posts: 852
Joined: 2012-01-23, 15:58 UTC
Location: Poland

Post by *MarcinW » 2018-05-30, 17:29 UTC

1) All problems with blinking seem to be fully fixed. Blinking now works even for 4 levels of windows: main window -> configuration window -> plugins / lister plugins / configure -> "Add" button :)

2) The problem described by DrShark in his last post is in fact completely unrelated. However, I suppose that it can be reproduced by using some drive that responses slowly - like a DVD drive or a network drive with limited bandwidh.

3) The nag screen window has still TApplication as its parent - not the main TC window.

Regards

Post Reply