[Xcb] Reading XResources

Peter Harris git at peter.is-a-geek.org
Tue Aug 11 14:05:00 PDT 2009


On Tue, Aug 11, 2009 at 3:56 PM, Donald Ephraim Curtis wrote:
> I am curious about getting the default DPI settings form the XServer.
> It looks like they are calculated based on the settings of pixesls and
> millimeters.  For now this seems OK and I can calculate them manually.
> But it would be nice to pull this information from the Xserver rather
> than calculating on my own, in the case that someone manually changes
> the DPI settings...

Aside from the metric <=> imperial conversion, DPI is pixels per mm.
You can't change one without changing the other.

The server does not have a separate DPI setting. Any UI you may have
that claims to change the DPI is actually changing the mm value under
the hood.

If you want the server to inform you when the user makes a change that
may affect DPI, you can use the xcb_randr_select_input function
(assuming the RandR extension is present).

Peter Harris


More information about the Xcb mailing list