[wayland HiDPI support, posible regression?]

Bill Spitzak spitzak at gmail.com
Tue Mar 10 12:00:36 PDT 2015


On 03/09/2015 10:32 PM, Jasper St. Pierre wrote:
> Mouse input is reported in a 24.8 fixed-point format. Subpixel mouse
> locations are entirely possible.

Yes events are doing this which is ok.

There is a problem that clients must round to the correct pixel. If the 
rounding done by the client does not match the rounding used by the 
compositor to position the mouse cursor there may be annoying 
misalignment of the graphics. However this problem exists for 
high-precision mice irregardless of high dpi settings, so it is probably 
best to just document the rounding that must be used to position 
cursors: to convert a 24.8 mouse position to a pixel use 
(x*scale+127)>>8, the offset must be 127 (not 0 or 128) and you must use 
right shift, not divide by 256 (because that will shift negative values 
in the wrong direction).

Events seem to be ok, but my complaint is that a large number of 
coordinates in the api other than events are in integer logical pixels, 
not in high dpi or in fixed-point. The offsets to attach are the biggest 
culprits. There are also integer clip rectangles in the subsurface and 
scaling apis. Except for compatibility there is no reason positions in 
messages cannot be in buffer pixels.


More information about the wayland-devel mailing list