Skip to content

WIP: wp-surface-scale-v1: new protocol

Joseph Burt requested to merge caseorum/wayland-protocols:surface-scale into main

This adds a communication channel for clients and compositors to indicate and suggest arbitrary surface scale factors. That is, not just fractional scales but also to affirmatively indicate that a surface is rendered to an integer scale.

The client renders and aligns entirely in the surface-local space and indicates the relative scale of that space. No client-side coordinate transforms are involved.

This is a copy of wayland!225 (closed) with the required boilerplate, itself a product of the very fruitful discussion in wayland#284.

This protocol is designed to allow every compositor to implement it as they see fit. If handle_set_scale_factor is a thin wrapper around wp_viewporter, its behavior is identical to !143 (merged). However, other compositors are not bound by that decision, and may implement the client's intent without the same induced rounding error. It is unimportant whether this particular protocol is merged, but I believe the principle that the protocol only communicates and does not force a particular compositor implementation is very much important.

I have abandoned my full-resolution implementation in sway, as it is considered far to intrusive. I will follow this shortly with a thin wrapper in wlroots/sway as discussed above, and full-resolution implementations in other compositors as I become familiar with their codebases.

Comments, corrections, suggestions, and complaints are most welcome!

Merge request reports