Go to index / Go to protocols

cosmic_corner_radius_v1 ↗

communicate corner radius of windows

This protocol provides a way for clients to communicate the corner radius of their toplevels, should they use rounded corners.

This hint can then be used by the compositor to draw fitting outlines or prevent overdrawing of other server-side drawn interfaces.

cosmic_corner_radius_v1
cosmic_corner_radius_manager_v1

Version 2
Compositor Support
Version 1
cosmic 1.0.0

corner radius global

Manager for creating corner-radius objects for existing surfaces

cosmic_corner_radius_manager_v1
request destroy()
Destructor

    Destroy the global

    Informs the server, that the client will no longer use this global. Any previously created corner-radius objects remain valid until destroyed.

    cosmic_corner_radius_manager_v1
    request get_corner_radius(
        id: new_id<cosmic_corner_radius_toplevel_v1>,
        toplevel: object<xdg_toplevel>,
    )
    Deprecated since version 2
    • id — the new cosmic_corner_radius_toplevel_v1 object
    • toplevel — the toplevel

    Create a new corner-radius object for an existing toplevel

    Instantiate an interface extension for the given xdg_toplevel to specify their corner radius.

    If the given xdg_toplevel already has a cosmic_corner_radius_toplevel_v1 object associated, the corner_radius_exists protocol error will be raised.

    Deprecated: Use get_corner_radius_surface instead.

    cosmic_corner_radius_manager_v1
    request get_corner_radius_surface(
        id: new_id<cosmic_corner_radius_toplevel_v1>,
        surface: object<xdg_surface>,
    )
    Available since version 2
    • id — the new cosmic_corner_radius_toplevel_v1 object
    • surface — the surface

    Create a new corner-radius object for an existing xdg-surface

    Instantiate an interface extension for the given xdg_surface to specify their corner radius.

    If the given xdg_surface already has a cosmic_corner_radius_toplevel_v1 object associated, the corner_radius_exists protocol error will be raised.

    It is an error submitting this request for a xdg+surface object, that doesn't have a role associated yet. (See xdg_surface::get_toplevel or xdg_surface::get_popup.) A no_role protocol error will be raised in this case.

    cosmic_corner_radius_manager_v1
    request get_corner_radius_layer(
        id: new_id<cosmic_corner_radius_layer_v1>,
        layer: object<zwlr_layer_surface_v1>,
    )
    Available since version 2
    • id — the new cosmic_corner_radius_layer_v1 object
    • layer — the layer surface

    Create a new corner-radius object for an existing layer

    Instantiate an interface extension for the given layer-surface to specify their corner radius.

    If the given layer-suface already has a cosmic_corner_radius_layer_v1 object associated, the corner_radius_exists protocol error will be raised.

    cosmic_corner_radius_manager_v1
    enum error {
        corner_radius_exists = 0,
        no_role = 1,
    }
    • corner_radius_exists — the surface already has a corner-radius object
    • no_role — the surface already has a corner-radius object

    cosmic_corner_radius_v1
    cosmic_corner_radius_toplevel_v1

    Version 1

    corner radius toplevel

    The corner-radius object provides a way to specify a corner-radius for it's associated toplevel.

    If the xdg_toplevel associated with the cosmic_corner_radius_toplevel_v1 object has been destroyed, this object becomes inert. Any further requests other than destroy will raise the toplevel_destroyed protocol error.

    cosmic_corner_radius_toplevel_v1
    request destroy()
    Destructor

      Destroy the corner-radius object

      Informs the server that the client will no longer be using this protocol object. The corner radius will be unset on the next commit.

      cosmic_corner_radius_toplevel_v1
      request set_radius(
          top_left: uint,
          top_right: uint,
          bottom_right: uint,
          bottom_left: uint,
      )
      • top_left — top-left corner radius
      • top_right — top-right corner radius
      • bottom_right — bottom-right corner radius
      • bottom_left — bottom-left corner radius

      Set corner radius

      This request sets the hinted corner radius values for rectangular windows.

      The corner radius hint is double-buffered state and will be applied on the next wl_surface.commit.

      The value is given in logical space relative to the window geometry of the associated xdg_toplevel. If any value exceeds a quarter of either dimension of the window geometry the radius_too_large protocol error is raised.

      cosmic_corner_radius_toplevel_v1
      request unset_radius()

        Unset corner radius

        Unsets any previously hinted corner radius values without invalidating the object for later use. Can be used by clients that possibly have temporary irregular shapes.

        cosmic_corner_radius_toplevel_v1
        enum error {
            toplevel_destroyed = 0,
            radius_too_large = 1,
        }
        • toplevel_destroyed — the associated toplevel object has been already destroyed
        • radius_too_large — the associated toplevel's window geometry isn't large enough for the requested radius

        cosmic_corner_radius_v1
        cosmic_corner_radius_layer_v1

        Version 1

        corner radius layer

        The corner-radius object provides a way to specify a corner-radius for it's associated layer surface.

        If the zwlr_layer_surface_v1 associated with the cosmic_corner_radius_layer_v1 object has been destroyed, this object becomes inert. Any further requests other than destroy will raise the layer_destroyed protocol error.

        cosmic_corner_radius_layer_v1
        request destroy()
        Destructor

          Destroy the corner-radius object

          Informs the server that the client will no longer be using this protocol object. The corner radius will be unset on the next commit.

          cosmic_corner_radius_layer_v1
          request set_radius(
              top_left: uint,
              top_right: uint,
              bottom_right: uint,
              bottom_left: uint,
          )
          • top_left — top-left corner radius
          • top_right — top-right corner radius
          • bottom_right — bottom-right corner radius
          • bottom_left — bottom-left corner radius

          Set corner radius

          This request sets the hinted corner radius values for rectangular layers.

          The corner radius hint is double-buffered state and will be applied on the next wl_surface.commit.

          The value is given in logical space relative to the remaining size of the associated zwlr_layer_surface_v1 after any said padding was applied. If any value exceeds half of the respective dimension of the remaining size the radius_too_large protocol error is raised.

          cosmic_corner_radius_layer_v1
          request unset_radius()

            Unset corner radius

            Unsets any previously hinted corner radius values without invalidating the object for later use. Can be used by clients that possibly have temporary irregular shapes.

            cosmic_corner_radius_layer_v1
            request set_padding(
                top: int,
                right: int,
                bottom: int,
                left: int,
            )
            • top — top padding
            • right — right padding
            • bottom — bottom left padding
            • left — left padding

            Set edge padding

            This request sets the hinted padding values for rectangular layers.

            The padding hint is double-buffered state and will be applied on the next wl_surface.commit.

            The value is given in logical space as the amount of pixels to subtract from the size of the associated zwlr_layer_surface and in the case of the top and left padding added to the layer position before applying the corner radius. Negative padding values are allowed.

            If any value exceeds half of the respective dimension of the surface size the padding_too_large protocol error is raised.

            cosmic_corner_radius_layer_v1
            request unset_padding()

              Unset edge padding

              Unsets any previously hinted padding values without invalidating the object for later use. Can be used by clients that possibly have temporary irregular shapes.

              cosmic_corner_radius_layer_v1
              enum error {
                  layer_destroyed = 0,
                  radius_too_large = 1,
                  padding_too_large = 2,
              }
              • layer_destroyed — the associated layer surface object has been already destroyed
              • radius_too_large — the associated layer's size isn't large enough for the requested radius
              • padding_too_large — the associated layer's size isn't large enough for the requested padding