<div dir="ltr"><span style="font-size:12.8000001907349px">a bit of warning before I begin: I'm not very familiar with X11 and only recently got asked to do some display work, so if anything seems naive or ill-informed, it is because I am.</span><br style="font-size:12.8000001907349px"><div style="font-size:12.8000001907349px"><br>I need to write something that can find the lowest level visible widget at the location and return the window ID, but find I'm having a wee bit of trouble. Given I know what display the widget is on 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; I then repeating to the bottom child. The problem I've run into is when 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've been playing with (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 hidden by 'buttonA'. The XQueryPointer always gets the right window however. Clearly checking for the dimensions and visibility isn't enough to pick the correct, exposed window.</div></div><div><br></div>-- <br><div class="gmail_signature"><div>Mike Stewart</div><div><a href="mailto:mstewart@altroninc.com" target="_blank">mstewart@altroninc.com</a></div><div>703-263-7306</div><div><br></div><div><font size="1"><span style="font-family:Consolas;background-color:rgb(255,255,255)">This electronic mail transmission,</span><span style="font-family:arial,sans-serif;background-color:rgb(255,255,255)"> </span><span style="font-family:Consolas;background-color:rgb(255,255,255)">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="font-family:Consolas;background-color:rgb(255,255,255)">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>