[PATCH 0/2] Support for high DPI outputs via scaling

John Kåre Alsaker john.kare.alsaker at gmail.com
Mon May 13 05:00:28 PDT 2013


Mon, May 13, 2013 at 1:26 PM, Alexander Larsson <alexl at redhat.com> wrote:

> On mån, 2013-05-13 at 12:40 +0200, John Kåre Alsaker wrote:
>
> > The scaling factor should not have any affect of any coordinate system
> > or anything else in the protocol. It should only affect the size in
> > pixels of the surfaces of the clients. Clients should do any
> > transformations of coordinates they want themselves.
>
> I'm not sure if we agree or not here. But, lemme have an example. If you
> have a setup with two monitors using mirrored mode, one with scale == 2.
> Then I want both monitors to show the same thing, one with more detail.
> If I then put the mouse cursor over the bottom right corner of the
> surface i want to get one mouse event, and the coordinates of it should
> be the size of the window in the unscaled coordinates, i.e. the
> width/height of the window in the lower resolution.
>
The client should get the width and height of the surface in pixels. If the
compositor doesn't display pixels in a 1:1 ratio on the monitor, it should
translate events into pixels in surface coordinates before sending them to
a client. The scaling factor should have no effect on anything (from a
protocol perspective) other than which pixel sizes the client picks.


> Is this what you meant?
>
> > Clients can easily scale larger features like icons, padding and fonts
> > and round them to pixel sizes and draw sharp output even with a
> > fractional scaling factor. This allows users to pick a size suitable
> > for them. The difference between a 1 and 2 scaling factor is too huge.
>
> Some things can be easily scaled. Like text and photorealistic images.
> Other things can't necessarily be scaled and still look nice. Like line
> art or solid line borders (like e.g. the boxes around a button). Sure,
> you can round everything to "nearest int", but that will cause
> unevenness in the rounding (buttons sometimes get a 1 pixel border,
> sometimes 2 depending on the fractional part of the button coords, etc).
> So, I don't think this is every useful in practice.
>
Even if things aren't perfectly even, it will still be much better than the
alternative which is round up to the next scaling factor and let the
compositor scale the surface down to a suitable size again. This is what
you have to do on Mac OS X to get a reasonable workspace on higher DPI
displays. Windows gets 4 times bigger from scaling factor 1 to 2. That
isn't near enough granular.


>
> > I think the case when a window is displayed on multiple monitors is
> > pretty rare or short in duration (the dragging across monitor case
> > when not using a workspace per monitor). I suppose we could leave this
> > up to the compositor.
>
> Totally, i don't mean that the priority is useful for that case.
> Normally clients should just pick the scale based on which output the
> surface has the "most" pixels in. However, the one case where that
> breaks is mirrored/clone mode, where two monitors show the same thing.
> This is where the priority can be useful.
>
In mirrored/clone mode only a single wl_output would be presented to
clients with a single scale factor, so priorities won't matter in that
case.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20130513/c5e17a8f/attachment-0001.html>


More information about the wayland-devel mailing list