# DPI

Xpra synchronizes the DPI from the client to the server, so that applications will render with the correct settings and "look right" on the client. This may affect fonts, window sizes, cursors sizes, etc.

See also: image depth

## Important caveats:

- support varies greatly depending on the operating system and version, desktop environment, number of monitors attached and their resolution, etc
- with X11, there are far too many places where the DPI can be looked up, many places where it can be overridden
- for virtualized "hardware DPI" which some applications calculate from the virtual monitor dimensions, you will need a v0.4.0 or later Xdummy driver. With Xvfb or with older versions of the `dummy` driver, the hardware DPI - as reported by `xdpyinfo` - cannot be updated at runtime and must be set in advance, either in the `/etc/xpra/xorg.conf` file or on the `Xvfb` command line
- many applications will not reload the DPI settings, so they must be started after the client connects to get the correct DPI value (you may want to use `start-after-connect`)

## Debugging

For debugging or reporting issues, the most relevant pieces of information can be collected from:

- client and server debug output with `-d dpi` command line switch
- `xdpyinfo` output
- `xrandr` output

## Technical details

- Physical vs logical DPI on X
- Of DPIs, desktops, and toolkits
- win32 API:
- WM_DPICHANGED
- GetDpiForMonitor
- SetProcessDpiAwareness
- Writing DPI-Aware Desktop and Win32 Applications
- Scaling Windows - The DPI Arms Race, in particular: Windows 8.1 - More DPI Changes
- About High Resolution for OS X
- Qt: Retina display support for Mac OS, iOS and X11
- xserver forces 96 DPI on randr-1.2-capable drivers, overriding correct autodetection
- please add option to avoid forcing of 96dpi
- xserver forces 96 DPI on randr-1.2-capable drivers, overriding correct autodetection
- Xorg: setting DPI manually
- KDE & Qt Applications and High DPI Displays with Scaling
- how different versions of windows use different icon sizes and where
- with `Gnome`, there are many more scaling and font settings, ie: `gsettings set org.gnome.desktop.interface text-scaling-factor 1.5`

## xpra DPI issues

- #882 Do not use Debian or Ubuntu - these distributions seem unable to run `dummy` properly
- Ubuntu packaging problems
- #697 GTK screen dimension detection is broken with high DPI displays on windows7 and later
- #163 pass client DPI preference to server and use sane default value of `96`
- #976 client display scaling
- #919 frame extents synchronization
- #887 chrome DPI
- #1086 DPI handling improvements, MacOS support
- #1215 patched dummy driver for Debian and Ubuntu
- #1193 bug with client command line switch handling
- #1526 per-monitor DPI with MS Windows clients
- #1933 HIDPI awareness for MacOS