Skip to content

protocol: add wl_surface.preferred_buffer_scale and transform

Simon Ser requested to merge emersion/wayland:surface-scale into main

Right now, clients need to bind to wl_output globals, listen to wl_output.scale, listen to wl_surface.enter/leave, pick the highest scale factor.

This is an issue because it breaks Wayland's "policy, not mechanism" motto. Clients take the decision of which scale to use depending on the outputs they're on, compositors have no say in this (apart from faking output events, which isn't great).

This commit introduces a new wl_surface.preferred_buffer_scale event to allow compositors to directly indicate the preferred scale factor for each surface.

This unlocks features which require dynamically changing the scale such as:

  • Accessibility features such as screen magnifier
  • In a VR environment, render surfaces close to the eye at a higher scale
  • HiDPI screenshots on LoDPI screens

Closes: #271 (closed)

Implementations:

Edited by Simon Ser

Merge request reports