Comment 7 for bug 8357

Revision history for this message
James Henstridge (jamesh) wrote :

The "Screen Resolution" control panel uses the RANDR extension, which lets you
change the resolution and rotate the screen at runtime. From a quick look at
the header file, there is nothing for setting the DPI, and this doesn't really
surprise me.

If an app wants to find out what the DPI of the screen is, they need to do the
following:
 1. ask for the height/width of the screen in pixels (using WidthOfScreen() and
HeightOfScreen() functions)
 2. ask for the height/width of the screen in millimetres (using
WidthMMOfScreen() HeightMMOfScreen())
 3. divide the width in pixels by the width in inches (converted from
millimetres). The same for height.

The physical size is either detected from the monitor, or entered manually into
the X config file. Since the X server is working with the physical size of the
screen, there is no other value to change when changing resolutions. Similarly,
for a rotation you just swap the physical screen width/height.

So I don't think it would be possible to change the server DPI through the
control panel.