Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!uunet!mcsun!hp4nl!phcisa!phcisa.uucp!frans From: frans@origin.nl Newsgroups: comp.windows.x Subject: Re: How can I get the display resolution? Message-ID: <1362@phcisa.UUCP> Date: 25 Mar 91 13:47:38 GMT References: <9103250507.AA07479@lightning.McRCIM.McGill.EDU> Sender: frans@phcisa.UUCP Reply-To: frans@phcisa.uucp () Organization: ORIGIN/Middleware,Eindhoven,The Netherlands Lines: 20 In-reply-to: mouse@lightning.mcrcim.mcgill.EDU's message of 25 Mar 91 05:07:17 GMT The solution you propose is a bit of turning the problem around. The HeightMMOfScreen(screen) call references the screen resolution as defined within the X server. At least in the Sun Server implementation, this is is a hard-coded constant ( I believe somewhere in server/ddx/mfb/??? ), defined to be 90 (pixels per inch). If you want to have the HeightMMOfScreen(screen) call to return the right value, you have to start the X process with the right argument ( -dpi 83 e.g.) so that the default value gets overruled. (You can check this behaviour very easily: if you run xdpyinfo in a high or low resolution display, the resolution reported remains the same, but the size of the screen reported changes ! Best greetings, Francois Staes Origin/Middleware Eindhoven, The Netherlands.