[PATCH 00/15] weston scaling support
Bill Spitzak
spitzak at gmail.com
Tue Jun 4 18:11:54 PDT 2013
John Kåre Alsaker wrote:
> This is still a problem without any high-DPI stuff. You could just as
> easily have an input device with a resolution 3 times higher than the
> display.
I am worried that most clients will work around the problem of the scale
proposal by rounding all numbers from 3.5 to 4.5 to 4, thus throwing
away the high resolution input device.
Lets assume a screen has scale 3 and there is a pointing device with a
resolution of 1/2 of these pixels. And the client is drawing a full-res
surface.
(note the numbers here looks strange but they are the closest decimal to
the 24.8 fixed-point values. That is why it is .332, not .333):
Under your proposal a normal pointing device will return 1, 1.332,
1.664, 2, ... as coordinates. If the client just blindly multiplies by 3
they will get 3, 3.996, 4.992, 6. I think most clients will fix this by
rounding to the nearest integer to get 3, 4, 5, 6.
Now the high-resolution device will return 1, 1.164, 1.332, 1.5, 1.664,
1.832, 2. If the client blindly multiplies these by 3 they will get 3,
3.492, 3.996, 4.5, 4.992, 5.496, 6. However if the client rounds
(possibly because the author never saw a high-resolution pointer) they
will get 3, 3, 4, 4, 5, 5, 6, thus losing the high-resolution.
In my proposal a normal pointing device will return 3, 4, 5, 6. The
client will not need to round. The high-resolution device will return 3,
3.5, 4, 4.5, 5, 5.5, 6. Since the client does not round, it will get
these values correctly.
Of course the client could only round numbers that are "close" to
integers, but I still feel my solution is simpler.
More information about the wayland-devel
mailing list