<div dir="ltr">So fair warning, I've recently been asked to do some display work and I'm not extremely familiar with it. <br><div><br>I am currently in the midst of trying to write something that can identify the lowest level visible widget at the location and return the window ID, but find I'm having a wee bit of trouble. Using the known display and the default root window of that display, I was attempting to find the window ID of a button widget by recursively calling XQueryTree. I am calling XQueryTree,  then use XGetWindowAttributes to check the child windows for visibility and if the given x,y pairing are inside of them, and then repeating to the bottom child. The problem I've run into is I have a situation where two buttons are stacked on top of each other. I have no idea how to tell the difference between an exposed window and one that is covered up. Both end up having identical attributes returned from XGetWindowAttributes, so I have no idea how to tell which one is actually exposed. <div><br></div><div>Clearly there is some way to do this, but I do not understand it. I can get to the correct window if I instead depend on XQueryPointer and recursively call it with the subwindow of the previous XQueryPointer's results, however I'm trying to do this without moving the mouse. <br><br>Attached is the source for a small test app I'm trying this in, case my description wasn't particularly clear. When I run this test app and mouse over buttonA stacked on top of buttonB, the XQueryTree ends up returning the window id of buttonB regardless of if its the exposed button, or if buttonA is the exposed button. the XQueryPointer always gets the right window however. Clearly checking for the dimensions and visibility isn't enough to pick the correct, exposed window. <br clear="all"><div><br></div>-- <br><div><div>Mike Stewart</div><div><a href="mailto:mstewart@altroninc.com" target="_blank">mstewart@altroninc.com</a></div><div><a href="tel:703-263-7306" value="+17032637306" target="_blank">703-263-7306</a></div><div><br></div><div><font size="1"><span style="background-color:rgb(255,255,255);font-family:Consolas">This electronic mail transmission,</span><span style="font-family:arial,sans-serif;background-color:rgb(255,255,255)"> </span><span style="background-color:rgb(255,255,255);font-family:Consolas">including any attachments, may contain certain information (technical data, proprietary information,</span><span style="font-family:arial,sans-serif;background-color:rgb(255,255,255)"> </span><span style="background-color:rgb(255,255,255);font-family:Consolas">etc.) whose dissemination is controlled by US export laws and regulations, DOD Distribution <span style="background-color:rgb(255,255,204)">D</span> <span style="background-color:rgb(255,255,204)">statements</span>, or non-disclosure agreements.  Unauthorized review, use, disclosure, or distribution is prohibited.</span></font></div></div>
</div></div></div>