Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!sdd.hp.com!decwrl!shelby!bloom-beacon!SHAMASH.MCRCIM.MCGILL.EDU!mouse From: mouse@SHAMASH.MCRCIM.MCGILL.EDU (der Mouse) Newsgroups: comp.windows.x Subject: Re: Getting window position Message-ID: <9008012225.AA17467@shamash.McRCIM.McGill.EDU> Date: 1 Aug 90 22:25:03 GMT Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 28 >> My next step was to find the position and size of the X window after >> an expose event. > I assume that you need the position of the top left of thw window > with respect to the root window coordinates. > Why not try [XTranslateCoordinates] > If someone thinks there could be problems with this, please do inform > me. I have used this method in some packages and am so far not > having any problems. The potential problems are mostly race conditions. The basic problem is that there's essentially no synchronization. Yes, XTranslateCoordinates will give you the result, but it may be out of date even before you get it. The window manager can move the window at any time. (A correctly functioning window manager will ensure that you get some event - a ConfigureNotify, I think - when this happens, but in the presence of a correctly functioning window manager there is no problem to start with.[%]) der Mouse old: mcgill-vision!mouse new: mouse@larry.mcrcim.mcgill.edu [%] Or more precisely will ensure that such an event is generated; if you don't select for it that's your lookout.