Simple Directmedia Layer
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

wayland: Add cursor-shape-v1 protocol support

+306 -38
+27 -4
src/video/wayland/SDL_waylandevents.c
··· 56 56 #define BTN_SIDE (0x113) 57 57 #define BTN_EXTRA (0x114) 58 58 #endif 59 + #include "../../events/SDL_keysym_to_scancode_c.h" 60 + #include "../../events/imKStoUCS.h" 61 + #include <errno.h> 59 62 #include <sys/mman.h> 60 63 #include <unistd.h> 61 - #include <errno.h> 64 + #include <xkbcommon/xkbcommon-compose.h> 62 65 #include <xkbcommon/xkbcommon.h> 63 - #include <xkbcommon/xkbcommon-compose.h> 64 - #include "../../events/imKStoUCS.h" 65 - #include "../../events/SDL_keysym_to_scancode_c.h" 66 + #include "cursor-shape-v1-client-protocol.h" 66 67 67 68 /* Weston uses a ratio of 10 units per scroll tick */ 68 69 #define WAYLAND_WHEEL_AXIS_UNIT 10 ··· 245 246 } 246 247 } 247 248 249 + void Wayland_CreateCursorShapeDevice(struct SDL_WaylandInput *input) 250 + { 251 + SDL_VideoData *viddata = input->display; 252 + 253 + if (viddata->cursor_shape_manager) { 254 + if (input->pointer && !input->cursor_shape) { 255 + input->cursor_shape = wp_cursor_shape_manager_v1_get_pointer(viddata->cursor_shape_manager, input->pointer); 256 + } 257 + } 258 + } 259 + 248 260 /* Returns SDL_TRUE if a key repeat event was due */ 249 261 static SDL_bool keyboard_repeat_handle(SDL_WaylandKeyboardRepeat *repeat_info, Uint64 elapsed) 250 262 { ··· 1696 1708 input->pointer = wl_seat_get_pointer(seat); 1697 1709 SDL_memset(&input->pointer_curr_axis_info, 0, sizeof(input->pointer_curr_axis_info)); 1698 1710 input->display->pointer = input->pointer; 1711 + 1712 + Wayland_CreateCursorShapeDevice(input); 1713 + 1699 1714 wl_pointer_set_user_data(input->pointer, input); 1700 1715 wl_pointer_add_listener(input->pointer, &pointer_listener, 1701 1716 input); 1702 1717 } else if (!(caps & WL_SEAT_CAPABILITY_POINTER) && input->pointer) { 1718 + if (input->cursor_shape) { 1719 + wp_cursor_shape_device_v1_destroy(input->cursor_shape); 1720 + input->cursor_shape = NULL; 1721 + } 1703 1722 wl_pointer_destroy(input->pointer); 1704 1723 input->pointer = NULL; 1705 1724 input->display->pointer = NULL; ··· 3064 3083 } else { 3065 3084 wl_keyboard_destroy(input->keyboard); 3066 3085 } 3086 + } 3087 + 3088 + if (input->cursor_shape) { 3089 + wp_cursor_shape_device_v1_destroy(input->cursor_shape); 3067 3090 } 3068 3091 3069 3092 if (input->pointer) {
+2
src/video/wayland/SDL_waylandevents_c.h
··· 102 102 SDL_WaylandDataDevice *data_device; 103 103 SDL_WaylandPrimarySelectionDevice *primary_selection_device; 104 104 SDL_WaylandTextInput *text_input; 105 + struct wp_cursor_shape_device_v1 *cursor_shape; 105 106 struct zwp_relative_pointer_v1 *relative_pointer; 106 107 struct zwp_input_timestamps_v1 *keyboard_timestamps; 107 108 struct zwp_input_timestamps_v1 *pointer_timestamps; ··· 209 210 extern void Wayland_input_destroy_tablet(struct SDL_WaylandInput *input); 210 211 211 212 extern void Wayland_RegisterTimestampListeners(struct SDL_WaylandInput *input); 213 + extern void Wayland_CreateCursorShapeDevice(struct SDL_WaylandInput *input); 212 214 213 215 /* The implicit grab serial needs to be updated on: 214 216 * - Keyboard key down/up
+88 -5
src/video/wayland/SDL_waylandmouse.c
··· 41 41 #include "wayland-cursor.h" 42 42 #include "SDL_waylandmouse.h" 43 43 44 + #include "cursor-shape-v1-client-protocol.h" 45 + 44 46 #include "../../SDL_hints_c.h" 45 47 46 48 static SDL_Cursor *sys_cursors[SDL_HITTEST_RESIZE_LEFT + 1]; ··· 529 531 SDL_free(cursor); 530 532 return NULL; 531 533 } 534 + 532 535 cursor->driverdata = (void *)cdata; 533 536 534 - cdata->surface = wl_compositor_create_surface(data->compositor); 535 - wl_surface_set_user_data(cdata->surface, NULL); 536 - 537 - /* Note that we can't actually set any other cursor properties, as this 537 + /* The surface is only necessary if the cursor shape manager is not present. 538 + * 539 + * Note that we can't actually set any other cursor properties, as this 538 540 * is output-specific. See wayland_get_system_cursor for the rest! 539 541 */ 542 + if (!data->cursor_shape_manager) { 543 + cdata->surface = wl_compositor_create_surface(data->compositor); 544 + wl_surface_set_user_data(cdata->surface, NULL); 545 + } 546 + 540 547 cdata->system_cursor = id; 541 548 } 542 549 ··· 581 588 SDL_free(cursor); 582 589 } 583 590 591 + static void Wayland_SetSystemCursorShape(struct SDL_WaylandInput *input, SDL_SystemCursor id) 592 + { 593 + Uint32 shape; 594 + 595 + switch (id) { 596 + case SDL_SYSTEM_CURSOR_ARROW: 597 + shape = WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_DEFAULT; 598 + break; 599 + case SDL_SYSTEM_CURSOR_IBEAM: 600 + shape = WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_TEXT; 601 + break; 602 + case SDL_SYSTEM_CURSOR_WAIT: 603 + shape = WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_WAIT; 604 + break; 605 + case SDL_SYSTEM_CURSOR_CROSSHAIR: 606 + shape = WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_CROSSHAIR; 607 + break; 608 + case SDL_SYSTEM_CURSOR_WAITARROW: 609 + shape = WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_PROGRESS; 610 + break; 611 + case SDL_SYSTEM_CURSOR_SIZENWSE: 612 + shape = WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_NWSE_RESIZE; 613 + break; 614 + case SDL_SYSTEM_CURSOR_SIZENESW: 615 + shape = WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_NESW_RESIZE; 616 + break; 617 + case SDL_SYSTEM_CURSOR_SIZEWE: 618 + shape = WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_EW_RESIZE; 619 + break; 620 + case SDL_SYSTEM_CURSOR_SIZENS: 621 + shape = WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_NS_RESIZE; 622 + break; 623 + case SDL_SYSTEM_CURSOR_SIZEALL: 624 + shape = WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_ALL_SCROLL; 625 + break; 626 + case SDL_SYSTEM_CURSOR_NO: 627 + shape = WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_NOT_ALLOWED; 628 + break; 629 + case SDL_SYSTEM_CURSOR_HAND: 630 + shape = WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_POINTER; 631 + break; 632 + case SDL_SYSTEM_CURSOR_WINDOW_TOPLEFT: 633 + shape = WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_NW_RESIZE; 634 + break; 635 + case SDL_SYSTEM_CURSOR_WINDOW_TOP: 636 + shape = WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_N_RESIZE; 637 + break; 638 + case SDL_SYSTEM_CURSOR_WINDOW_TOPRIGHT: 639 + shape = WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_NE_RESIZE; 640 + break; 641 + case SDL_SYSTEM_CURSOR_WINDOW_RIGHT: 642 + shape = WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_E_RESIZE; 643 + break; 644 + case SDL_SYSTEM_CURSOR_WINDOW_BOTTOMRIGHT: 645 + shape = WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_SE_RESIZE; 646 + break; 647 + case SDL_SYSTEM_CURSOR_WINDOW_BOTTOM: 648 + shape = WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_S_RESIZE; 649 + break; 650 + case SDL_SYSTEM_CURSOR_WINDOW_BOTTOMLEFT: 651 + shape = WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_SW_RESIZE; 652 + break; 653 + case SDL_SYSTEM_CURSOR_WINDOW_LEFT: 654 + shape = WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_W_RESIZE; 655 + break; 656 + default: 657 + SDL_assert(0); /* Should never be here... */ 658 + shape = WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_DEFAULT; 659 + } 660 + 661 + wp_cursor_shape_device_v1_set_shape(input->cursor_shape, input->pointer_enter_serial, shape); 662 + } 663 + 584 664 static int Wayland_ShowCursor(SDL_Cursor *cursor) 585 665 { 586 666 SDL_VideoDevice *vd = SDL_GetVideoDevice(); ··· 598 678 599 679 /* TODO: High-DPI custom cursors? -flibit */ 600 680 if (!data->shm_data) { 601 - if (!wayland_get_system_cursor(d, data, &scale)) { 681 + if (input->cursor_shape) { 682 + Wayland_SetSystemCursorShape(input, data->system_cursor); 683 + return 0; 684 + } else if (!wayland_get_system_cursor(d, data, &scale)) { 602 685 return -1; 603 686 } 604 687 }
+41 -29
src/video/wayland/SDL_waylandvideo.c
··· 23 23 24 24 #ifdef SDL_VIDEO_DRIVER_WAYLAND 25 25 26 - #include "../../events/SDL_events_c.h" 27 26 #include "../../core/linux/SDL_system_theme.h" 27 + #include "../../events/SDL_events_c.h" 28 28 29 - #include "SDL_waylandvideo.h" 29 + #include "SDL_waylandclipboard.h" 30 30 #include "SDL_waylandevents_c.h" 31 - #include "SDL_waylandwindow.h" 32 - #include "SDL_waylandopengles.h" 33 - #include "SDL_waylandmouse.h" 34 31 #include "SDL_waylandkeyboard.h" 35 - #include "SDL_waylandclipboard.h" 36 - #include "SDL_waylandvulkan.h" 37 32 #include "SDL_waylandmessagebox.h" 33 + #include "SDL_waylandmouse.h" 34 + #include "SDL_waylandopengles.h" 35 + #include "SDL_waylandvideo.h" 36 + #include "SDL_waylandvulkan.h" 37 + #include "SDL_waylandwindow.h" 38 38 39 + #include <fcntl.h> 39 40 #include <sys/types.h> 40 41 #include <unistd.h> 41 - #include <fcntl.h> 42 42 #include <xkbcommon/xkbcommon.h> 43 43 44 44 #include <wayland-util.h> 45 45 46 - #include "xdg-shell-client-protocol.h" 47 - #include "xdg-decoration-unstable-v1-client-protocol.h" 46 + #include "cursor-shape-v1-client-protocol.h" 47 + #include "fractional-scale-v1-client-protocol.h" 48 + #include "idle-inhibit-unstable-v1-client-protocol.h" 49 + #include "input-timestamps-unstable-v1-client-protocol.h" 50 + #include "kde-output-order-v1-client-protocol.h" 48 51 #include "keyboard-shortcuts-inhibit-unstable-v1-client-protocol.h" 49 - #include "idle-inhibit-unstable-v1-client-protocol.h" 50 - #include "xdg-activation-v1-client-protocol.h" 51 - #include "text-input-unstable-v3-client-protocol.h" 52 - #include "tablet-unstable-v2-client-protocol.h" 53 - #include "xdg-output-unstable-v1-client-protocol.h" 54 - #include "viewporter-client-protocol.h" 52 + #include "pointer-constraints-unstable-v1-client-protocol.h" 55 53 #include "primary-selection-unstable-v1-client-protocol.h" 56 - #include "fractional-scale-v1-client-protocol.h" 57 - #include "input-timestamps-unstable-v1-client-protocol.h" 58 54 #include "relative-pointer-unstable-v1-client-protocol.h" 59 - #include "pointer-constraints-unstable-v1-client-protocol.h" 60 - #include "kde-output-order-v1-client-protocol.h" 55 + #include "tablet-unstable-v2-client-protocol.h" 56 + #include "text-input-unstable-v3-client-protocol.h" 57 + #include "viewporter-client-protocol.h" 58 + #include "xdg-activation-v1-client-protocol.h" 59 + #include "xdg-decoration-unstable-v1-client-protocol.h" 60 + #include "xdg-output-unstable-v1-client-protocol.h" 61 + #include "xdg-shell-client-protocol.h" 61 62 62 63 #ifdef HAVE_LIBDECOR_H 63 64 #include <libdecor.h> ··· 200 201 static void Wayland_FlushOutputOrder(SDL_VideoData *vid) 201 202 { 202 203 SDL_WaylandConnectorName *c, *tmp; 203 - wl_list_for_each_safe (c, tmp, &vid->output_order, link) { 204 + wl_list_for_each_safe(c, tmp, &vid->output_order, link) 205 + { 204 206 WAYLAND_wl_list_remove(&c->link); 205 207 SDL_free(c); 206 208 } ··· 796 798 /* ...and the compositor scales the logical viewport... */ 797 799 if (video->viewporter) { 798 800 /* ...and viewports are supported, calculate the true scale of the output. */ 799 - driverdata->scale_factor = (float) native_mode.w / (float)driverdata->screen_width; 801 + driverdata->scale_factor = (float)native_mode.w / (float)driverdata->screen_width; 800 802 } else { 801 803 /* ...otherwise, the 'native' pixel values are a multiple of the logical screen size. */ 802 804 driverdata->pixel_width = driverdata->screen_width * (int)driverdata->scale_factor; ··· 906 908 } 907 909 908 910 static const struct wl_output_listener output_listener = { 909 - display_handle_geometry, /* Version 1 */ 910 - display_handle_mode, /* Version 1 */ 911 - display_handle_done, /* Version 2 */ 912 - display_handle_scale, /* Version 2 */ 913 - display_handle_name, /* Version 4 */ 911 + display_handle_geometry, /* Version 1 */ 912 + display_handle_mode, /* Version 1 */ 913 + display_handle_done, /* Version 2 */ 914 + display_handle_scale, /* Version 2 */ 915 + display_handle_name, /* Version 4 */ 914 916 display_handle_description /* Version 4 */ 915 917 }; 916 918 ··· 978 980 SDL_DisplayData *d; 979 981 980 982 Wayland_SortOutputs(vid); 981 - wl_list_for_each(d, &vid->output_list, link) { 983 + wl_list_for_each (d, &vid->output_list, link) { 982 984 d->display = SDL_AddVideoDisplay(&d->placeholder, SDL_FALSE); 983 985 SDL_free(d->placeholder.name); 984 986 SDL_zero(d->placeholder); ··· 1072 1074 if (d->input) { 1073 1075 Wayland_RegisterTimestampListeners(d->input); 1074 1076 } 1077 + } else if (SDL_strcmp(interface, "wp_cursor_shape_manager_v1") == 0) { 1078 + d->cursor_shape_manager = wl_registry_bind(d->registry, id, &wp_cursor_shape_manager_v1_interface, 1); 1079 + if (d->input) { 1080 + Wayland_CreateCursorShapeDevice(d->input); 1081 + } 1075 1082 } else if (SDL_strcmp(interface, "kde_output_order_v1") == 0) { 1076 1083 d->kde_output_order = wl_registry_bind(d->registry, id, &kde_output_order_v1_interface, 1); 1077 1084 kde_output_order_v1_add_listener(d->kde_output_order, &kde_output_order_listener, d); ··· 1081 1088 static void display_remove_global(void *data, struct wl_registry *registry, uint32_t id) 1082 1089 { 1083 1090 SDL_VideoData *d = data; 1084 - SDL_DisplayData *node; 1091 + SDL_DisplayData *node; 1085 1092 1086 1093 /* We don't get an interface, just an ID, so assume it's a wl_output :shrug: */ 1087 1094 wl_list_for_each (node, &d->output_list, link) { ··· 1318 1325 if (data->input_timestamps_manager) { 1319 1326 zwp_input_timestamps_manager_v1_destroy(data->input_timestamps_manager); 1320 1327 data->input_timestamps_manager = NULL; 1328 + } 1329 + 1330 + if (data->cursor_shape_manager) { 1331 + wp_cursor_shape_manager_v1_destroy(data->cursor_shape_manager); 1332 + data->cursor_shape_manager = NULL; 1321 1333 } 1322 1334 1323 1335 if (data->kde_output_order) {
+1
src/video/wayland/SDL_waylandvideo.h
··· 67 67 } shell; 68 68 struct zwp_relative_pointer_manager_v1 *relative_pointer_manager; 69 69 struct zwp_pointer_constraints_v1 *pointer_constraints; 70 + struct wp_cursor_shape_manager_v1 *cursor_shape_manager; 70 71 struct wl_data_device_manager *data_device_manager; 71 72 struct zwp_primary_selection_device_manager_v1 *primary_selection_device_manager; 72 73 struct zxdg_decoration_manager_v1 *decoration_manager;
+147
wayland-protocols/cursor-shape-v1.xml
··· 1 + <?xml version="1.0" encoding="UTF-8"?> 2 + <protocol name="cursor_shape_v1"> 3 + <copyright> 4 + Copyright 2018 The Chromium Authors 5 + Copyright 2023 Simon Ser 6 + 7 + Permission is hereby granted, free of charge, to any person obtaining a 8 + copy of this software and associated documentation files (the "Software"), 9 + to deal in the Software without restriction, including without limitation 10 + the rights to use, copy, modify, merge, publish, distribute, sublicense, 11 + and/or sell copies of the Software, and to permit persons to whom the 12 + Software is furnished to do so, subject to the following conditions: 13 + The above copyright notice and this permission notice (including the next 14 + paragraph) shall be included in all copies or substantial portions of the 15 + Software. 16 + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 19 + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22 + DEALINGS IN THE SOFTWARE. 23 + </copyright> 24 + 25 + <interface name="wp_cursor_shape_manager_v1" version="1"> 26 + <description summary="cursor shape manager"> 27 + This global offers an alternative, optional way to set cursor images. This 28 + new way uses enumerated cursors instead of a wl_surface like 29 + wl_pointer.set_cursor does. 30 + 31 + Warning! The protocol described in this file is currently in the testing 32 + phase. Backward compatible changes may be added together with the 33 + corresponding interface version bump. Backward incompatible changes can 34 + only be done by creating a new major version of the extension. 35 + </description> 36 + 37 + <request name="destroy" type="destructor"> 38 + <description summary="destroy the manager"> 39 + Destroy the cursor shape manager. 40 + </description> 41 + </request> 42 + 43 + <request name="get_pointer"> 44 + <description summary="manage the cursor shape of a pointer device"> 45 + Obtain a wp_cursor_shape_device_v1 for a wl_pointer object. 46 + </description> 47 + <arg name="cursor_shape_device" type="new_id" interface="wp_cursor_shape_device_v1"/> 48 + <arg name="pointer" type="object" interface="wl_pointer"/> 49 + </request> 50 + 51 + <request name="get_tablet_tool_v2"> 52 + <description summary="manage the cursor shape of a tablet tool device"> 53 + Obtain a wp_cursor_shape_device_v1 for a zwp_tablet_tool_v2 object. 54 + </description> 55 + <arg name="cursor_shape_device" type="new_id" interface="wp_cursor_shape_device_v1"/> 56 + <arg name="tablet_tool" type="object" interface="zwp_tablet_tool_v2"/> 57 + </request> 58 + </interface> 59 + 60 + <interface name="wp_cursor_shape_device_v1" version="1"> 61 + <description summary="cursor shape for a device"> 62 + This interface advertises the list of supported cursor shapes for a 63 + device, and allows clients to set the cursor shape. 64 + </description> 65 + 66 + <enum name="shape"> 67 + <description summary="cursor shapes"> 68 + This enum describes cursor shapes. 69 + 70 + The names are taken from the CSS W3C specification: 71 + https://w3c.github.io/csswg-drafts/css-ui/#cursor 72 + </description> 73 + <entry name="default" value="1" summary="default cursor"/> 74 + <entry name="context_menu" value="2" summary="a context menu is available for the object under the cursor"/> 75 + <entry name="help" value="3" summary="help is available for the object under the cursor"/> 76 + <entry name="pointer" value="4" summary="pointer that indicates a link or another interactive element"/> 77 + <entry name="progress" value="5" summary="progress indicator"/> 78 + <entry name="wait" value="6" summary="program is busy, user should wait"/> 79 + <entry name="cell" value="7" summary="a cell or set of cells may be selected"/> 80 + <entry name="crosshair" value="8" summary="simple crosshair"/> 81 + <entry name="text" value="9" summary="text may be selected"/> 82 + <entry name="vertical_text" value="10" summary="vertical text may be selected"/> 83 + <entry name="alias" value="11" summary="drag-and-drop: alias of/shortcut to something is to be created"/> 84 + <entry name="copy" value="12" summary="drag-and-drop: something is to be copied"/> 85 + <entry name="move" value="13" summary="drag-and-drop: something is to be moved"/> 86 + <entry name="no_drop" value="14" summary="drag-and-drop: the dragged item cannot be dropped at the current cursor location"/> 87 + <entry name="not_allowed" value="15" summary="drag-and-drop: the requested action will not be carried out"/> 88 + <entry name="grab" value="16" summary="drag-and-drop: something can be grabbed"/> 89 + <entry name="grabbing" value="17" summary="drag-and-drop: something is being grabbed"/> 90 + <entry name="e_resize" value="18" summary="resizing: the east border is to be moved"/> 91 + <entry name="n_resize" value="19" summary="resizing: the north border is to be moved"/> 92 + <entry name="ne_resize" value="20" summary="resizing: the north-east corner is to be moved"/> 93 + <entry name="nw_resize" value="21" summary="resizing: the north-west corner is to be moved"/> 94 + <entry name="s_resize" value="22" summary="resizing: the south border is to be moved"/> 95 + <entry name="se_resize" value="23" summary="resizing: the south-east corner is to be moved"/> 96 + <entry name="sw_resize" value="24" summary="resizing: the south-west corner is to be moved"/> 97 + <entry name="w_resize" value="25" summary="resizing: the west border is to be moved"/> 98 + <entry name="ew_resize" value="26" summary="resizing: the east and west borders are to be moved"/> 99 + <entry name="ns_resize" value="27" summary="resizing: the north and south borders are to be moved"/> 100 + <entry name="nesw_resize" value="28" summary="resizing: the north-east and south-west corners are to be moved"/> 101 + <entry name="nwse_resize" value="29" summary="resizing: the north-west and south-east corners are to be moved"/> 102 + <entry name="col_resize" value="30" summary="resizing: that the item/column can be resized horizontally"/> 103 + <entry name="row_resize" value="31" summary="resizing: that the item/row can be resized vertically"/> 104 + <entry name="all_scroll" value="32" summary="something can be scrolled in any direction"/> 105 + <entry name="zoom_in" value="33" summary="something can be zoomed in"/> 106 + <entry name="zoom_out" value="34" summary="something can be zoomed out"/> 107 + </enum> 108 + 109 + <enum name="error"> 110 + <entry name="invalid_shape" value="1" 111 + summary="the specified shape value is invalid"/> 112 + </enum> 113 + 114 + <request name="destroy" type="destructor"> 115 + <description summary="destroy the cursor shape device"> 116 + Destroy the cursor shape device. 117 + 118 + The device cursor shape remains unchanged. 119 + </description> 120 + </request> 121 + 122 + <request name="set_shape"> 123 + <description summary="set device cursor to the shape"> 124 + Sets the device cursor to the specified shape. The compositor will 125 + change the cursor image based on the specified shape. 126 + 127 + The cursor actually changes only if the input device focus is one of 128 + the requesting client's surfaces. If any, the previous cursor image 129 + (surface or shape) is replaced. 130 + 131 + The "shape" argument must be a valid enum entry, otherwise the 132 + invalid_shape protocol error is raised. 133 + 134 + This is similar to the wl_pointer.set_cursor and 135 + zwp_tablet_tool_v2.set_cursor requests, but this request accepts a 136 + shape instead of contents in the form of a surface. Clients can mix 137 + set_cursor and set_shape requests. 138 + 139 + The serial parameter must match the latest wl_pointer.enter or 140 + zwp_tablet_tool_v2.proximity_in serial number sent to the client. 141 + Otherwise the request will be ignored. 142 + </description> 143 + <arg name="serial" type="uint" summary="serial number of the enter event"/> 144 + <arg name="shape" type="uint" enum="shape"/> 145 + </request> 146 + </interface> 147 + </protocol>