Window obscured

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

Questions about motif? Contact us

5 posts / 0 new
Last post
Window obscured

Submitted by Anonymous on Wed, 11/15/2000 - 16:28. Developers
cHi,

Is there any way to see if a window is obscured by
others on the desktop?

I tried using XQueryTree to retreive all the windows and
then compare the "space" they occupy, but XQueryTree
coredumps?

Anyone know a bug with XQueryTree?

Thanks

Steve

Anonymous

Hello, Steve!

I am using this piece of code for similar purposes,
i.e. to check if there is any point in redrawing window
contnets after loading new file or something like that.
There are other fileds "state" structure which you might
want to check, if you want more detailed info.

Dusan Peterc

int widgetIsViewable(Widget w)
{
XWindowAttributes state;

if (XtIsRealized(w))
XGetWindowAttributes(xinfo.dpy, XtWindow(w), &state);
else
return(FALSE);
if (state.map_state==IsViewable) return(TRUE);
else return(FALSE);
}

Anonymous

Hi Dusan

Thanks for the info about XGetWindowAttribute

I was able to find what I needed with the following function
XGetWindowAttributes
XtWindowToWidget
XtTranslateCoords
XQueryTree

Steve

ICS_support

I think that what this code really does (sorry, in the absence of my reference books) is check whether the window in question is mapped and at least partially visible. To track whether the window is completely obscured, I believe that it is necessary to track the VisibilityNotify events on the window. Those give information about the "degree" of visibility of the window.

In the original question, the user described that XQueryTree is core-dumping. Remember that it returns information; see http//www.motifzone.com/resources/man/XQueryTree.html for details on the information that comes back and that should be freed.

Anonymous

Yes that is what it does. But by using a combination of the aboved mentionned calls I was able to get the information needed.

I sent a Q and A to Kenton Lee`s FAQ page explaining the process.