Go to index / Go to protocols

cursor_shape_v1 ↗

cursor_shape_v1
wp_cursor_shape_manager_v1

Version 2
Compositor Support
Version 2
cosmic 1.0.0
jay 1.14.0
kwin 6.7
muffin 6.7.4
mutter 51
niri 26.04
Version 1
hyprland 0.52.1
labwc 0.20.2
phoc 0.55
river 0.3.13
sway 1.11
treeland 0.8.0

cursor shape manager

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.

wp_cursor_shape_manager_v1
request destroy()
Destructor

    destroy the manager

    Destroy the cursor shape manager.

    wp_cursor_shape_manager_v1
    request get_pointer(
        cursor_shape_device: new_id<wp_cursor_shape_device_v1>,
        pointer: object<wl_pointer>,
    )

      manage the cursor shape of a pointer device

      Obtain a wp_cursor_shape_device_v1 for a wl_pointer object.

      When the pointer capability is removed from the wl_seat, the wp_cursor_shape_device_v1 object becomes inert.

      wp_cursor_shape_manager_v1
      request get_tablet_tool_v2(
          cursor_shape_device: new_id<wp_cursor_shape_device_v1>,
          tablet_tool: object<zwp_tablet_tool_v2>,
      )

        manage the cursor shape of a tablet tool device

        Obtain a wp_cursor_shape_device_v1 for a zwp_tablet_tool_v2 object.

        When the zwp_tablet_tool_v2 is removed, the wp_cursor_shape_device_v1 object becomes inert.

        cursor_shape_v1
        wp_cursor_shape_device_v1

        Version 2

        cursor shape for a device

        This interface allows clients to set the cursor shape.

        wp_cursor_shape_device_v1
        enum shape {
            default = 1,
            context_menu = 2,
            help = 3,
            pointer = 4,
            progress = 5,
            wait = 6,
            cell = 7,
            crosshair = 8,
            text = 9,
            vertical_text = 10,
            alias = 11,
            copy = 12,
            move = 13,
            no_drop = 14,
            not_allowed = 15,
            grab = 16,
            grabbing = 17,
            e_resize = 18,
            n_resize = 19,
            ne_resize = 20,
            nw_resize = 21,
            s_resize = 22,
            se_resize = 23,
            sw_resize = 24,
            w_resize = 25,
            ew_resize = 26,
            ns_resize = 27,
            nesw_resize = 28,
            nwse_resize = 29,
            col_resize = 30,
            row_resize = 31,
            all_scroll = 32,
            zoom_in = 33,
            zoom_out = 34,
            dnd_ask = 35,
            all_resize = 36,
        }
        • default — default cursor
        • context_menu — a context menu is available for the object under the cursor
        • help — help is available for the object under the cursor
        • pointer — pointer that indicates a link or another interactive element
        • progress — progress indicator
        • wait — program is busy, user should wait
        • cell — a cell or set of cells may be selected
        • crosshair — simple crosshair
        • text — text may be selected
        • vertical_text — vertical text may be selected
        • alias — drag-and-drop: alias of/shortcut to something is to be created
        • copy — drag-and-drop: something is to be copied
        • move — drag-and-drop: something is to be moved
        • no_drop — drag-and-drop: the dragged item cannot be dropped at the current cursor location
        • not_allowed — drag-and-drop: the requested action will not be carried out
        • grab — drag-and-drop: something can be grabbed
        • grabbing — drag-and-drop: something is being grabbed
        • e_resize — resizing: the east border is to be moved
        • n_resize — resizing: the north border is to be moved
        • ne_resize — resizing: the north-east corner is to be moved
        • nw_resize — resizing: the north-west corner is to be moved
        • s_resize — resizing: the south border is to be moved
        • se_resize — resizing: the south-east corner is to be moved
        • sw_resize — resizing: the south-west corner is to be moved
        • w_resize — resizing: the west border is to be moved
        • ew_resize — resizing: the east and west borders are to be moved
        • ns_resize — resizing: the north and south borders are to be moved
        • nesw_resize — resizing: the north-east and south-west corners are to be moved
        • nwse_resize — resizing: the north-west and south-east corners are to be moved
        • col_resize — resizing: that the item/column can be resized horizontally
        • row_resize — resizing: that the item/row can be resized vertically
        • all_scroll — something can be scrolled in any direction
        • zoom_in — something can be zoomed in
        • zoom_out — something can be zoomed out
        • dnd_ask — drag-and-drop: the user will select which action will be carried out (non-css value)
          Available since version 2
        • all_resize — resizing: something can be moved or resized in any direction (non-css value)
          Available since version 2

        cursor shapes

        This enum describes cursor shapes.

        The names are taken from the CSS W3C specification: https://w3c.github.io/csswg-drafts/css-ui/#cursor with a few additions.

        Note that there are some groups of cursor shapes that are related: The first group is drag-and-drop cursors which are used to indicate the selected action during dnd operations. The second group is resize cursors which are used to indicate resizing and moving possibilities on window borders. It is recommended that the shapes in these groups should use visually compatible images and metaphors.

        wp_cursor_shape_device_v1
        enum error {
            invalid_shape = 1,
        }
        • invalid_shape — the specified shape value is invalid
        wp_cursor_shape_device_v1
        request destroy()
        Destructor

          destroy the cursor shape device

          Destroy the cursor shape device.

          The device cursor shape remains unchanged.

          wp_cursor_shape_device_v1
          request set_shape(
              serial: uint,
              shape: uint<shape>,
          )
          • serial — serial number of the enter event

          set device cursor to the 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.