COSMIC corner radius
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_manager_v1
Manager for creating corner-radius objects for existing surfaces
destroy()
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 |
|---|---|---|
| id | new_id<cosmic_corner_radius_toplevel_v1> | the new cosmic_corner_radius_toplevel_v1 object |
| toplevel | object<xdg_toplevel> | the 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 |
|---|---|---|
| id | new_id<cosmic_corner_radius_toplevel_v1> | the new cosmic_corner_radius_toplevel_v1 object |
| surface | object<xdg_surface> | the 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 |
|---|---|---|
| id | new_id<cosmic_corner_radius_layer_v1> | the new cosmic_corner_radius_layer_v1 object |
| layer | object<zwlr_layer_surface_v1> | the layer surface |
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.
error { corner_radius_exists, no_role }
Argument | Value | Description |
|---|---|---|
| corner_radius_exists | 0 | the surface already has a corner-radius object |
| no_role | 1 | the surface already has a corner-radius object |
cosmic_corner_radius_toplevel_v1
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()
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_left | uint | top-left corner radius |
| top_right | uint | top-right corner radius |
| bottom_right | uint | bottom-right corner radius |
| bottom_left | uint | bottom-left 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()
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.
error { toplevel_destroyed, radius_too_large }
Argument | Value | Description |
|---|---|---|
| toplevel_destroyed | 0 | the associated toplevel object has been already destroyed |
| radius_too_large | 1 | the associated toplevel's window geometry isn't large enough for the requested radius |
cosmic_corner_radius_layer_v1
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()
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_left | uint | top-left corner radius |
| top_right | uint | top-right corner radius |
| bottom_right | uint | bottom-right corner radius |
| bottom_left | uint | bottom-left 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()
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 | Type | Description |
|---|---|---|
| top | int | top padding |
| right | int | right padding |
| bottom | int | bottom left padding |
| left | int | left 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()
Unsets any previously hinted padding values without invalidating the object for later use. Can be used by clients that possibly have temporary irregular shapes.
error { layer_destroyed, radius_too_large, padding_too_large }
Argument | Value | Description |
|---|---|---|
| layer_destroyed | 0 | the associated layer surface object has been already destroyed |
| radius_too_large | 1 | the associated layer's size isn't large enough for the requested radius |
| padding_too_large | 2 | the associated layer's size isn't large enough for the requested padding |
Compositor Support
| cosmic_corner_radius_manager_v1 | ↓ | ||
| Compositors | |||
| Cage | 0.3.0 | x | |
| COSMIC | 1.11.0 | 2 | |
| flakewm | 3.0.5 | x | |
| GameScope | 3.17.0 | x | |
| Hyprland | 0.57.2 | x | |
| Jay | 1.14.0 | x | |
| KWin | 6.7 | x | |
| Labwc | 0.20.2 | x | |
| Louvre | 2.14.1 | x | |
| Mango | 0.16.3 | x | |
| Mir | 2.26 | x | |
| Muffin | 6.7.4 | x | |
| Mutter | 51 | x | |
| niri | 26.04 | x | |
| phoc | 0.55 | x | |
| Pila | 0.5.1 | x | |
| Qtile | 0.37.1 | x | |
| river | 0.5.0 | x | |
| Sway | 1.11 | x | |
| Treeland | 0.8.0 | x | |
| Wayfire | 0.9.0 | x | |
| Weston | 15.0.1 | x | |
Copyright
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.