Path: utzoo!attcan!uunet!lll-winken!ncis.llnl.gov!helios.ee.lbl.gov!pasteur!ucbvax!tut.cis.ohio-state.edu!bloom-beacon!ATHENA.MIT.EDU!swick From: swick@ATHENA.MIT.EDU (Ralph R Swick) Newsgroups: comp.windows.x Subject: Re: XTranslateCoordinates Message-ID: <8903171727.AA13677@LYRE.MIT.EDU> Date: 17 Mar 89 17:27:38 GMT References: <8903171621.AA18094@litsun5.litsun2.epfl.ch> Sender: daemon@bloom-beacon.MIT.EDU Organization: DEC/MIT Project Athena Lines: 19 > XTranslateCoordinates takes among other inputs the screen > number. How does an application find the screen number? For example, > I have the following line of code: > > XTranslateCoordinates( XtDisplay(widget), XtWindow(widget), > RootWindow( XtDisplay(widget), SCREEN_NUMBER), > 0, 0, &shellx, &shelly, &w ); If you really want the screen number, you'll have to code your own loop that compares XtScreen(widget) with ScreenOfDisplay(XtDisplay(widget), loop_index). In the example you give, a much simpler solution is to use RootWindowOfScreen(XtScreen(widget)) instead of RootWindow(). > I know about XtTranslateCoords(), but it doesn't work (see next > posting). This is a known bug (under some window managers, e.g. uwm).