BREITH Karl-Albert FEEC-G (AREVA NP GmbH) wrote:
>
> VW7.3.1:
> Is there a way to check whether a window is on top of display ?
>
> A window is opened and displayed. Then the mouse is moved to another
> window,
> which becomes the top window due to a sensitive mouse.
> The isActive or isVisible methods return true, even if the window is
> (due to the
> sensitive mouse) behind other windows.
> How can I check whether a window is really on the top or at least really
> visible ?
>
Screen default queryStackingOrder collect: [:h | DisplaySurface findRegistrant: h]
lists the windows on the screen from bottom to top. So if
myWindow == DisplaySurface findRegistrant: Screen default queryStackingOrder last
is true then myWindow is not behind another window. But since there can be more than one
window that is not covered by other windows, this expression can be false even if
myWindow is completely visible. You need to compare its position with the position of all windows
"above" it to check that it is not hidden by these windows.
HTH,
Ralf Propach
Georg Heeg eK