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.
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.
Version 2
Compositor Support
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
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
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
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