any windows on top

This forum is read only. No new submissions are accepted.

Questions about motif? Contact us

4 posts / 0 new
Last post
any windows on top

Submitted by Anonymous on Wed, 01/23/2002 - 12:53. Developers
Hello,

Is there anyway to tell if there is another window sitting on top the one you are interested in.

Thanks

ICS_support

You can add an event handler and track the VisibilityNotify events, which can tell you whether the window is obscured or not. Some widgets, such as clocks, use this feature, as handled by Xt, to avoid doing extra processing if the window isn`t visible.

In addition, you can do XQueryTree() and confirm that your window is on top of the stacking order. Of course, if it isn`t, it may still not be obscured. And there are race conditions.

Anonymous

Thanks for the info.

I`ve tried setting the VisibilityNotify event but there is still a problem how can I tell if the window is partially off screen vs. partially covered by other windows?

dlei

ICS_support

Well, you know the window`s size and coordinates, so you can do an XTranslateCoordinates (http//www.motifzone.com/resources/man/XTranslateCoordinates.html) to get the boundaries in absolute terms.