Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!purdue!haven!decuac!shlump.nac.dec.com!shodha.dec.com!gsrc.enet.dec.com!west From: west@gsrc.enet.dec.com (Jim West (Stealth Contractor)) Newsgroups: comp.windows.x Subject: Re: Getting window position Message-ID: <1515@shodha.dec.com> Date: 31 Jul 90 17:32:13 GMT Sender: news@shodha.dec.com Organization: Digital Equipment Corporation Lines: 46 In article <2919@dftsrv.gsfc.nasa.gov>, joe@etac632 (Joe Fulson-Woytek) writes... >I have written the standard "helloworld" program as described in the >"Introduction to the X Window System" by Oliver Jones. My goal is to >use X on an Iris, a Sun, and an HP. The basic program works on all 3. >My next step was to find the position and size of the X window after an >expose event. The likely candidates seemed to be XGetGeometry or >XGetWindowAttributes. Either of these work fine on the Iris. BUt on >both the HP and the Sun, the size is right but the x and y position >come out as 0, 0 (I should note that I do an XGetGeometry before the >Event loop and it returns the correct x and y position - I only have >problems within the event loop). I next tried to check for a >ConfigureNotify event and use the XConfigureEvent structure to get >the x and y. This also returned a 0,0 on the Sun (I haven't tried the >ConfigureNotify on the other systems). One more note - the problem is >with the server - I can run my program on the HP or Sun and display >on the IRIS and get the window position. > >Any suggestions would be greatly appreciated. > > >Joe FUlson-Woytek Have you tried XTranslateCoordinates relative to the root window? The x and y values are relative to the windows parent. It looks like on the IRIS that the root window is the parent whereas on the HP and SUN there is a window between you and the root...probably window manager frame window. ---------------------------------------------------------------------- Jim West | The Schainker Converse west@gsrc.enet.dec.com | to Hoare's Law : | These are my opinions. | Inside every small problem Digital has no idea | is a larger problem struggling what I'm saying. | to get out. ---------------------------------------------------------------------- ---------------------------------------------------------------------- Jim West | The Schainker Converse west@gsrc.enet.dec.com | to Hoare's Law : | These are my opinions. | Inside every small problem Digital has no idea | is a larger problem struggling what I'm saying. | to get out. ----------------------------------------------------------------------