Go to index / Go to protocols

wlr_gamma_control_unstable_v1 ↗

manage gamma tables of outputs

This protocol allows a privileged client to set the gamma tables for outputs.

Warning! The protocol described in this file is experimental and backward incompatible changes may be made. Backward compatible changes may be added together with the corresponding interface version bump. Backward incompatible changes are done by bumping the version number in the protocol and interface names and resetting the interface version. Once the protocol is to be declared stable, the 'z' prefix and the version number in the protocol and interface names are removed and the interface version number is reset.

wlr_gamma_control_unstable_v1
zwlr_gamma_control_manager_v1

Version 1
Compositor Support
Version 1
cage 0.3.0
hyprland 0.52.1
jay 1.14.0
labwc 0.20.2
louvre 2.14.1
niri 26.04
phoc 0.55
river 0.3.13
sway 1.11
treeland 0.8.0
wayfire 0.9.0

manager to create per-output gamma controls

This interface is a manager that allows creating per-output gamma controls.

zwlr_gamma_control_manager_v1
request get_gamma_control(
    id: new_id<zwlr_gamma_control_v1>,
    output: object<wl_output>,
)

    get a gamma control for an output

    Create a gamma control that can be used to adjust gamma tables for the provided output.

    zwlr_gamma_control_manager_v1
    request destroy()
    Destructor

      destroy the manager

      All objects created by the manager will still remain valid, until their appropriate destroy request has been called.

      wlr_gamma_control_unstable_v1
      zwlr_gamma_control_v1

      Version 1

      adjust gamma tables for an output

      This interface allows a client to adjust gamma tables for a particular output.

      The client will receive the gamma size, and will then be able to set gamma tables. At any time the compositor can send a failed event indicating that this object is no longer valid.

      There can only be at most one gamma control object per output, which has exclusive access to this particular output. When the gamma control object is destroyed, the gamma table is restored to its original value.

      zwlr_gamma_control_v1
      event gamma_size(
          size: uint,
      )
      • size — number of elements in a ramp

      size of gamma ramps

      Advertise the size of each gamma ramp.

      This event is sent immediately when the gamma control object is created.

      zwlr_gamma_control_v1
      enum error {
          invalid_gamma = 1,
      }
      • invalid_gamma — invalid gamma tables
      zwlr_gamma_control_v1
      request set_gamma(
          fd: fd,
      )
      • fd — gamma table file descriptor

      set the gamma table

      Set the gamma table. The file descriptor can be memory-mapped to provide the raw gamma table, which contains successive gamma ramps for the red, green and blue channels. Each gamma ramp is an array of 16-byte unsigned integers which has the same length as the gamma size.

      The file descriptor data must have the same length as three times the gamma size.

      zwlr_gamma_control_v1
      event failed()

        object no longer valid

        This event indicates that the gamma control is no longer valid. This can happen for a number of reasons, including:

        • The output doesn't support gamma tables

        • Setting the gamma tables failed

        • Another client already has exclusive gamma control for this output

        • The compositor has transferred gamma control to another client

        Upon receiving this event, the client should destroy this object.

        zwlr_gamma_control_v1
        request destroy()
        Destructor

          destroy this control

          Destroys the gamma control object. If the object is still valid, this restores the original gamma tables.