Cursor shape
wp_cursor_shape_manager_v1
This global offers an alternative, optional way to set cursor images. This new way uses enumerated cursors instead of a wl_surface like wl_pointer.set_cursor does.
Warning! The protocol described in this file is currently in the testing phase. Backward compatible changes may be added together with the corresponding interface version bump. Backward incompatible changes can only be done by creating a new major version of the extension.
destroy()
Destroy the cursor shape manager.
get_pointer(cursor_shape_device: new_id<wp_cursor_shape_device_v1>, pointer: object<wl_pointer>)
Argument | Type | Description |
---|---|---|
cursor_shape_device | new_id<wp_cursor_shape_device_v1> | |
pointer | object<wl_pointer> |
Obtain a wp_cursor_shape_device_v1 for a wl_pointer object.
get_tablet_tool_v2(cursor_shape_device: new_id<wp_cursor_shape_device_v1>, tablet_tool: object<zwp_tablet_tool_v2>)
Argument | Type | Description |
---|---|---|
cursor_shape_device | new_id<wp_cursor_shape_device_v1> | |
tablet_tool | object<zwp_tablet_tool_v2> |
Obtain a wp_cursor_shape_device_v1 for a zwp_tablet_tool_v2 object.
wp_cursor_shape_device_v1
This interface allows clients to set the cursor shape.
destroy()
Destroy the cursor shape device.
The device cursor shape remains unchanged.
set_shape(serial: uint, shape: uint<wp_cursor_shape_device_v1.shape>)
Argument | Type | Description |
---|---|---|
serial | uint | serial number of the enter event |
shape | uint<wp_cursor_shape_device_v1.shape> |
Sets the device cursor to the specified shape. The compositor will change the cursor image based on the specified shape.
The cursor actually changes only if the input device focus is one of the requesting client's surfaces. If any, the previous cursor image (surface or shape) is replaced.
The "shape" argument must be a valid enum entry, otherwise the invalid_shape protocol error is raised.
This is similar to the wl_pointer.set_cursor and zwp_tablet_tool_v2.set_cursor requests, but this request accepts a shape instead of contents in the form of a surface. Clients can mix set_cursor and set_shape requests.
The serial parameter must match the latest wl_pointer.enter or zwp_tablet_tool_v2.proximity_in serial number sent to the client. Otherwise the request will be ignored.
shape { default, context_menu, help, pointer, progress, wait, cell, crosshair, text, vertical_text, alias, copy, move, no_drop, not_allowed, grab, grabbing, e_resize, n_resize, ne_resize, nw_resize, s_resize, se_resize, sw_resize, w_resize, ew_resize, ns_resize, nesw_resize, nwse_resize, col_resize, row_resize, all_scroll, zoom_in, zoom_out }
Argument | Value | Description |
---|---|---|
default | 1 | default cursor |
context_menu | 2 | a context menu is available for the object under the cursor |
help | 3 | help is available for the object under the cursor |
pointer | 4 | pointer that indicates a link or another interactive element |
progress | 5 | progress indicator |
wait | 6 | program is busy, user should wait |
cell | 7 | a cell or set of cells may be selected |
crosshair | 8 | simple crosshair |
text | 9 | text may be selected |
vertical_text | 10 | vertical text may be selected |
alias | 11 | drag-and-drop: alias of/shortcut to something is to be created |
copy | 12 | drag-and-drop: something is to be copied |
move | 13 | drag-and-drop: something is to be moved |
no_drop | 14 | drag-and-drop: the dragged item cannot be dropped at the current cursor location |
not_allowed | 15 | drag-and-drop: the requested action will not be carried out |
grab | 16 | drag-and-drop: something can be grabbed |
grabbing | 17 | drag-and-drop: something is being grabbed |
e_resize | 18 | resizing: the east border is to be moved |
n_resize | 19 | resizing: the north border is to be moved |
ne_resize | 20 | resizing: the north-east corner is to be moved |
nw_resize | 21 | resizing: the north-west corner is to be moved |
s_resize | 22 | resizing: the south border is to be moved |
se_resize | 23 | resizing: the south-east corner is to be moved |
sw_resize | 24 | resizing: the south-west corner is to be moved |
w_resize | 25 | resizing: the west border is to be moved |
ew_resize | 26 | resizing: the east and west borders are to be moved |
ns_resize | 27 | resizing: the north and south borders are to be moved |
nesw_resize | 28 | resizing: the north-east and south-west corners are to be moved |
nwse_resize | 29 | resizing: the north-west and south-east corners are to be moved |
col_resize | 30 | resizing: that the item/column can be resized horizontally |
row_resize | 31 | resizing: that the item/row can be resized vertically |
all_scroll | 32 | something can be scrolled in any direction |
zoom_in | 33 | something can be zoomed in |
zoom_out | 34 | something can be zoomed out |
This enum describes cursor shapes.
The names are taken from the CSS W3C specification: https://w3c.github.io/csswg-drafts/css-ui/#cursor
error { invalid_shape }
Argument | Value | Description |
---|---|---|
invalid_shape | 1 | the specified shape value is invalid |
Compositor Support
Mutter 46 | KWin 6.2 | Sway 1.9 | COSMIC 1.0.0 | Hyprland 0.42.0 | niri 0.1.8 | Weston 13 | Mir 2.18 | GameScope 3.15.14 | Jay 1.7.0 | |
---|---|---|---|---|---|---|---|---|---|---|
wp_cursor_shape_manager_v1 | x | 1 | 1 | x | 1 | 1 | x | x | x | 1 |
Copyright
Copyright 2018 The Chromium Authors Copyright 2023 Simon Ser
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.