Support wp_viewport for cursor surfaces
Wine Wayland allows applications to render in the native output resolution, regardless of any compositor side scaling. It uses wp_viewport
to achieve this goal (e.g., if scale=2 buffer=100x100 it sets viewport destination to 50x50 in order for the buffer to be displayed as 100x100 physical pixels on screen). Using wp_viewport
(rather than set_buffer_scale
) is also the only way to deal with fractional scales.
However, it seems that Mutter does not support wp_viewport
for cursor wl_surfaces. For integer scales, set_buffer_scale
can be used as a workaround, but for fractional scales the application needs to additionally provide a differently sized buffer so that the compositor can scale it down to the proper size (e.g., to display 24 pixels with a scale=1.5 the client would need to provide 32 pixels and set_buffer_scale(2)). This is both more complex for the clients, which need to be able to provide multiple cursor sizes depending on the scale, and can also result in visual degradation due to the extra scaling.
Supporting wp_viewport for cursor surfaces would allow clients to deal with cursor scaling (and especially fractional scaling) in a cleaner and more consistent way.