Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!umich!umeecs!zip!spencer From: spencer@eecs.umich.edu (Spencer W. Thomas) Newsgroups: comp.windows.x Subject: Re: Getting window position Message-ID: Date: 27 Jul 90 20:53:04 GMT References: <2919@dftsrv.gsfc.nasa.gov> Sender: news@zip.eecs.umich.edu Organization: University of Michigan EECS Dept Lines: 20 In-reply-to: joe@etac632's message of 27 Jul 90 14:26:40 GMT It appears that you are using a "reparenting" window manager on the Sun and HP (twm and mwm are such, uwm is not). The configurenotify event (and XGetGeometry) always return the position *relative to the parent window*. Without a window manager, or with one that doesn't reparent, the parent window is the root. With twm, mwm, and the like, the parent window is there to give you a title bar, drag handles, etc. Most frequently, your window is indeed at 0,0 within its parent. If you want to know where it is in the root, you can use XTranslateCoordinates. But, WHY do you care where the window is on the screen? Unless you are going to save the position information in a file so that you can restart the program with exactly the same position and size, there is almost no reason to need to know the window position. (I might note, also, that some window managers will not honor a placement request for a new window, even if it is "user specified".) -- =Spencer W. Thomas EECS Dept, U of Michigan, Ann Arbor, MI 48109 spencer@eecs.umich.edu 313-936-2616 (8-6 E[SD]T M-F)