Re: HiDPI and fractional scaling

On mån, 2014-02-03 at 14:19 +0100, Loïc Minier wrote:
On Mon, Feb 03, 2014, Alexander Larsson wrote:
Well, the way scaling works on X is that we set a global value for the
scale factor, and all apps just render that much larger. It is
impossible for an X app to render at two sizes for windows that stradle
monitors, and it is very hard to reliably and race-freely track what
output your window is and dynamically resize the geometry as it moves
around. Not to mention the many display-global options X has, such as
mouse acceleration, pointer size, etc, that would be wrong in a hidpi
multi-monitor situation.

Ah I see why you meant multi-monitor issues with X.  I'm indeed not sure
it's worth adding extensions to fix these, perhaps in a mixed stack e.g.
Wayland/X we can just keep X apps on one screen or the other, but not
allow rendering a window on two monitors at the same time.

I recently heard GNOME stack was assuming a hardcoded 96dpi.  Is this
still true and is this multi-monitors issue the only reason it does?

It seems to me X can properly expose the DPI, physical dimensions and
logical dimensions in pixels of each screen, so would it be possible to
use these correctly wherever the app starts, and signal the app if it
ever needs to move (as a whole) to a different output?

Its certainly possible to extract the exact dimensions of each monitor
(to the extent X detects these right) within the current Gtk+ APIs, and
if you care deeply it is possible to use these to render something at a
correct physical size. 

However, thats not how most things work, instead there is a default
"text dpi" that is global for all the monitors which defines the default
mapping of "font heights in points" to pixel sizes, and generally all
other measurements used by apps are directly in pixels. The text dpi is
96 dpi by default, but you can tweak it with the text-scale factor

Note that in general, things like "dpi" lead to physical sizes (like
inches) which are not useful for specifying sizes in a UI. You don't
want your buttons to be 0.5 inches on your TV, or projector. In general
you want an angular measure (i.e. a particular width of field in the
viewers vision). The only common such unit is the css "px", which is
defined as:

        The reference pixel is the visual angle of one pixel on a device
        with a pixel density of 96dpi and a distance from the reader of
        an arm's length. For a nominal arm's length of 28 inches, the
        visual angle is therefore about 0.0213 degrees. For reading at
        arm's length, 1px thus corresponds to about 0.26 mm
        (1/96 inch). 

Which is in practice what Gnome uses.

See the CSS spec for more details:

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]