Always On Top, does not work correctly.

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

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Always On Top, does not work correctly.

Post by *Balderstrom »

Prior to toggling AlwaysOnTop (AOT), TC 8.0b behaves properly:
--> TC 8.0b will stay underneath any other windows that have AOT toggled on.

After toggling AlwaysOnTop, TC does not behave properly. As I detail below.

=======================
Examples:
  • Notepad (normal, not AOT)
  • Calculator (AOT toggled on)
  • TC 8.0b, (AOT toggled on)
The calculator will stay on top of Notepad, always.
The Calculator can cover TC and vica versa.

Unexpected behaviour #1
1) Activate TC 8, (it is on top, covering parts of both Calculator and Notepad).
2) Click in the edit-area of notepad.
---> The calculator is on top of TC, notepad is not --- neither should be.

Unexpected behaviour #2
1) Activate TC 8, (it is on top, covering parts of both Calculator and Notepad).
2) Activate the Calculator.
3) Click anywhere on the Notepad Window.
---> Both the calculator and Notepad are on top of TC, only Calc should be.

Unexpected behaviour #3
1) Activate TC 8, (it is on top, covering parts of both Calculator and Notepad).
2) Click in the edit area of Notepad. (TC is still on top)
3) Click on Notepad's title bar...
---> Notepad goes on top of TC. Happens when skipping step 2 as well.
=======================

The behaviour of not staying on top when clicking on another Window's titlebar is interesting (not correct, but interesting). TC cannot stay on top of any window if it is not the active window when another program is activated - and that makes AlwaysOnTop with TC 8 very broken.

NOTE:
AlwaysOnTop can be toggled with many tools, e.g. WinRoll or even AutoHotkey:

Code: Select all

;; Alt+Win+A
!#a::WinSet, AlwaysOnTop, Toggle, % "ahk_id " WinExist("A")
User avatar
Flint
Power Member
Power Member
Posts: 3506
Joined: 2003-10-27, 09:25 UTC
Location: Belgrade, Serbia
Contact:

Post by *Flint »

Confirm all 3 issues, but with 64-bit TC only. 32-bit behaves correctly here.

XP x64; switching AOT performed via PowerPro (middle click on titlebar).
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 11.03 / Win10 x64
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50479
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

This seems to some sort of obscure Lazarus feature. In win32callback.inc, there seem to be various calls to RemoveStayOnTopFlags(), e.g. when the system sends WM_ENABLE and WM_ACTIVATEAPP messages. It seems that Lazarus removes "stay on top" when a program loses the focus, don't ask my why...
Author of Total Commander
https://www.ghisler.com
User avatar
Flint
Power Member
Power Member
Posts: 3506
Joined: 2003-10-27, 09:25 UTC
Location: Belgrade, Serbia
Contact:

Post by *Flint »

ghisler(Author) wrote:It seems that Lazarus removes "stay on top" when a program loses the focus, don't ask my why...
Maybe ask Lazarus developers? :)
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 11.03 / Win10 x64
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

ghisler(Author) wrote:This seems to some sort of obscure Lazarus feature. In win32callback.inc, there seem to be various calls to RemoveStayOnTopFlags(), e.g. when the system sends WM_ENABLE and WM_ACTIVATEAPP messages. It seems that Lazarus removes "stay on top" when a program loses the focus, don't ask my why...
That's hilarious. :twisted:
That defeats the whole purpose of AlwaysOnTop.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50479
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

I agree - I don't know what the reason is, may it's because such stay on top forms would also overlap other forms (e.g. dialog boxes)? TC does NOT use normal Delphi/Lazarus forms, it creates true child windows, so there wouldn't be any problem in TC.
Author of Total Commander
https://www.ghisler.com
User avatar
Flint
Power Member
Power Member
Posts: 3506
Joined: 2003-10-27, 09:25 UTC
Location: Belgrade, Serbia
Contact:

Post by *Flint »

Seems to be fixed in 8.0β5.
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 11.03 / Win10 x64
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50479
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

2Balderstrom
Could you test it too, please? I have commented out the calls to RemoveStayOnTopFlags() in the Lazarus source code.
Author of Total Commander
https://www.ghisler.com
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

Seems to be fine. All my tests worked as expected. Thanks.

Woulda normally checked early, but was burning the midnight oil all week trying to get a custom web-app working. Barely had time to eat!
*BLINK* TC9 Added WM_COPYDATA and WM_USER queries for scripting.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50479
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Thanks for checking it!
Author of Total Commander
https://www.ghisler.com
Post Reply