COSMIC corner radius

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.

corner radius global

Manager for creating corner-radius objects for existing surfaces

destroy()
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.

get_corner_radius(id: new_id<cosmic_corner_radius_toplevel_v1>, toplevel: object<xdg_toplevel>)
Argument
Type
Description
idnew_id<cosmic_corner_radius_toplevel_v1>
the new cosmic_corner_radius_toplevel_v1 object
toplevelobject<xdg_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.

get_corner_radius_surface(id: new_id<cosmic_corner_radius_toplevel_v1>, surface: object<xdg_surface>)
Argument
Type
Description
idnew_id<cosmic_corner_radius_toplevel_v1>
the new cosmic_corner_radius_toplevel_v1 object
surfaceobject<xdg_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.

get_corner_radius_layer(id: new_id<cosmic_corner_radius_layer_v1>, layer: object<zwlr_layer_surface_v1>)
Argument
Type
Description
idnew_id<cosmic_corner_radius_layer_v1>
the new cosmic_corner_radius_layer_v1 object
layerobject<zwlr_layer_surface_v1>
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.

Argument
Value
Description
corner_radius_exists0
the surface already has a corner-radius object
no_role1
the surface already has a corner-radius object

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.

destroy()
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.

set_radius(top_left: uint, top_right: uint, bottom_right: uint, bottom_left: uint)
Argument
Type
Description
top_leftuint
top-left corner radius
top_rightuint
top-right corner radius
bottom_rightuint
bottom-right corner radius
bottom_leftuint
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.

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.

Argument
Value
Description
toplevel_destroyed0
the associated toplevel object has been already destroyed
radius_too_large1
the associated toplevel's window geometry isn't large enough for the requested radius

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.

destroy()
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.

set_radius(top_left: uint, top_right: uint, bottom_right: uint, bottom_left: uint)
Argument
Type
Description
top_leftuint
top-left corner radius
top_rightuint
top-right corner radius
bottom_rightuint
bottom-right corner radius
bottom_leftuint
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.

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.

set_padding(top: int, right: int, bottom: int, left: int)
Argument
Type
Description
topint
top padding
rightint
right padding
bottomint
bottom left padding
leftint
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.

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.

Argument
Value
Description
layer_destroyed0
the associated layer surface object has been already destroyed
radius_too_large1
the associated layer's size isn't large enough for the requested radius
padding_too_large2
the associated layer's size isn't large enough for the requested padding

Compositor Support

cosmic_corner_radius_manager_v1↓
Compositors
CageCage0.3.0
x
COSMICCOSMIC1.11.0
2
flakewm3.0.5
x
GameScopeGameScope3.17.0
x
HyprlandHyprland0.57.2
x
Jay1.14.0
x
KWinKWin6.7
x
LabwcLabwc0.20.2
x
LouvreLouvre2.14.1
x
MangoMango0.16.3
x
MirMir2.26
x
MuffinMuffin6.7.4
x
MutterMutter51
x
niriniri26.04
x
phocphoc0.55
x
Pila0.5.1
x
QtileQtile0.37.1
x
riverriver0.5.0
x
SwaySway1.11
x
TreelandTreeland0.8.0
x
WayfireWayfire0.9.0
x
WestonWeston15.0.1
x

Copyright © 2024 System76

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.