Go to index / Go to protocols

xx_fractional_scale_v2 ↗

Protocol for fractional scaling

This protocol allows compositors and clients to communicate the coordinate space their surfaces act in.

xx_fractional_scale_v2
xx_fractional_scale_manager_v2

Version 1

creates surface scale interfaces

A global interface to create xx_fractional_scale_v2 interfaces.

xx_fractional_scale_manager_v2
request destroy()
Destructor

    release the global

    Informs the server that the client will not be using this protocol object anymore. This does not affect any other objects.

    xx_fractional_scale_manager_v2
    enum error {
        fractional_scale_exists = 0,
    }
    • fractional_scale_exists — xx_fractional_scale_v2 for the surface already exists
    xx_fractional_scale_manager_v2
    request get_fractional_scale(
        id: new_id<xx_fractional_scale_v2>,
        surface: object<wl_surface>,
    )
    • id — the new scale interface
    • surface — the surface

    create an interface to enable fractional scaling

    Create an interface object for a wl_surface to communicate scale. If the given wl_surface already has a xx_fractional_scale_v2 object associated, the fractional_scale_exists protocol error is raised.

    xx_fractional_scale_v2
    xx_fractional_scale_v2

    Version 1

    interface for fractional scaling

    An additional interface for a wl_surface object that allows compositor and client to communicate in a different coordinate space, in order to enable them to accurately describe coordinates and sizes in pixels. The two coordinate spaces in consideration are logical and pixels, where logical coordinates describe the size content should have and pixels describe the size of buffers.

    A scale of one equals a lack of scaling, where the communicated values define both logical coordinates and pixels. A scale greater than one describes that for every logical coordinate, more than one pixel is used, and a scale less than one describes that multiple logical coordinates make up one pixel. In mathematical terms, logical coordinates can be obtained by dividing the provided values by the currently active scale.

    The initial compositor and client coordinate scale factors are 1.

    xx_fractional_scale_v2
    event scale_factor(
        scale_8_24: uint,
    )
    • scale_8_24 — surface scale factor

    set the compositor coordinate space scale factor

    This event sets a scale factor for the associated wl_surface that describes the coordinate system the compositor will use for events following xx_fractional_scale_v2.scale_factor.

    The scale factor is encoded in a 8.24 fixed point format.

    The compositor must not send a scale of zero.

    The client should re-render and commit a new buffer with the new scale as soon as possible, in order to avoid artifacts caused by the mismatch in compositor and client scales.

    xx_fractional_scale_v2
    request set_scale_factor(
        scale_8_24: uint,
    )
    • scale_8_24 — surface scale factor

    set the client coordinate space scale factor

    This request sets a scale factor for the associated wl_surface that describes the coordinate system the client uses for requests following xx_fractional_scale_v2.set_scale_factor.

    The scale factor is encoded in a 8.24 fixed point format.

    If this scale factor does not match the scale factor provided by the compositor with xx_fractional_scale_v2.scale_factor, the compositor may apply transformations to the wl_surface that can result in blurriness or other artifacts.

    If scale_8_24 is zero, the error invalid_scale will be raised.

    xx_fractional_scale_v2
    request destroy()
    Destructor

      remove the scale interface from the surface

      The wl_surface's xx_fractional_scale_v2 object is destroyed, and the associated scale is reset to 1.

      xx_fractional_scale_v2
      enum error {
          invalid_scale = 0,
      }
      • invalid_scale — scale value is not valid