Windows partially obscured

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

Questions about motif? Contact us

4 posts / 0 new
Last post
Windows partially obscured

Submitted by Anonymous on Wed, 04/17/2002 - 18:33. Developers
I seem to remember reading about a solution to the problem I`m having below some time ago in these forums, but I can`t find
it now. I would appreciate a direction with which to find the answer if that is the case. Anyway, here`s my question

Is it possible for an application to find out if it is partially obsured by other windows?

I appreciate any help on this

steve----

ICS_support

Yes, in two ways.

You can do XQueryTree() (http//www.motifzone.com/resources/man/XQueryTree.html) and then get information on the windows to determine their locations relative to one another -- XQueryTree() already gives you the stacking order.

And, dynamically, you can track the VisibilityNotify events (http//www.motifzone.com/resources/man/XEvent.html) to know how stacking order and obfuscation change.

Anonymous

Thanks dbl,

I looked at the XEvents structures and noticed the VisibilityNotify event. Adding a handler
was very easy. All I did was add a call to XtAddEventHandler (toplevel_widget, VisibilityNotifyMask, False, event_handler, NULL)
Now, every time the window`s visibility changes, the handler gets called. In the handler, I set a flag to tell if
the window is obscured or not. Now, within a start script i can send a signal and that handler can tell if the
app. is obscured and pop it up to the top instead of starting another process.

steve---

ICS_support

OK!

You`ll also find some useful information at this address http//www.motifzone.com/tmd/articles/John_Cwikla/single.html

It is a solution to this problem "Once again, I was faced with the problem of having a single instance of our application running at a time".

It is possibly a more elegant solution than what you describe.