diff --git a/src/events/SDL_keyboard.c b/src/events/SDL_keyboard.c index fc06f07258..e281f5daaa 100644 --- a/src/events/SDL_keyboard.c +++ b/src/events/SDL_keyboard.c @@ -172,19 +172,6 @@ void SDL_RemoveKeyboard(SDL_KeyboardID keyboardID, bool send_event) } } -void SDL_SetKeyboardName(SDL_KeyboardID keyboardID, const char *name) -{ - SDL_assert(keyboardID != 0); - - const int keyboard_index = SDL_GetKeyboardIndex(keyboardID); - - if (keyboard_index >= 0) { - SDL_KeyboardInstance *instance = &SDL_keyboards[keyboard_index]; - SDL_free(instance->name); - instance->name = SDL_strdup(name ? name : ""); - } -} - bool SDL_HasKeyboard(void) { return (SDL_keyboard_count > 0); diff --git a/src/events/SDL_keyboard_c.h b/src/events/SDL_keyboard_c.h index 9a6589ddb2..ddfb5c5747 100644 --- a/src/events/SDL_keyboard_c.h +++ b/src/events/SDL_keyboard_c.h @@ -43,9 +43,6 @@ extern void SDL_AddKeyboard(SDL_KeyboardID keyboardID, const char *name, bool se // A keyboard has been removed from the system extern void SDL_RemoveKeyboard(SDL_KeyboardID keyboardID, bool send_event); -// Set or update the name of a keyboard instance. -extern void SDL_SetKeyboardName(SDL_KeyboardID keyboardID, const char *name); - // Set the mapping of scancode to key codes extern void SDL_SetKeymap(SDL_Keymap *keymap, bool send_event); diff --git a/src/events/SDL_mouse.c b/src/events/SDL_mouse.c index 5838d47cf8..54611bf36d 100644 --- a/src/events/SDL_mouse.c +++ b/src/events/SDL_mouse.c @@ -413,19 +413,6 @@ void SDL_RemoveMouse(SDL_MouseID mouseID, bool send_event) } } -void SDL_SetMouseName(SDL_MouseID mouseID, const char *name) -{ - SDL_assert(mouseID != 0); - - const int mouse_index = SDL_GetMouseIndex(mouseID); - - if (mouse_index >= 0) { - SDL_MouseInstance *instance = &SDL_mice[mouse_index]; - SDL_free(instance->name); - instance->name = SDL_strdup(name ? name : ""); - } -} - bool SDL_HasMouse(void) { return (SDL_mouse_count > 0); diff --git a/src/events/SDL_mouse_c.h b/src/events/SDL_mouse_c.h index 0bc913b94e..c25974ba82 100644 --- a/src/events/SDL_mouse_c.h +++ b/src/events/SDL_mouse_c.h @@ -169,9 +169,6 @@ extern void SDL_AddMouse(SDL_MouseID mouseID, const char *name, bool send_event) // A mouse has been removed from the system extern void SDL_RemoveMouse(SDL_MouseID mouseID, bool send_event); -// Set or update the name of a mouse instance. -extern void SDL_SetMouseName(SDL_MouseID mouseID, const char *name); - // Get the mouse state structure extern SDL_Mouse *SDL_GetMouse(void); diff --git a/src/events/SDL_touch.c b/src/events/SDL_touch.c index bf3cc02354..e825117c82 100644 --- a/src/events/SDL_touch.c +++ b/src/events/SDL_touch.c @@ -205,16 +205,6 @@ int SDL_AddTouch(SDL_TouchID touchID, SDL_TouchDeviceType type, const char *name return index; } -// Set or update the name of a touch. -void SDL_SetTouchName(SDL_TouchID id, const char *name) -{ - SDL_Touch *touch = SDL_GetTouch(id); - if (touch) { - SDL_free(touch->name); - touch->name = SDL_strdup(name ? name : ""); - } -} - static bool SDL_AddFinger(SDL_Touch *touch, SDL_FingerID fingerid, float x, float y, float pressure) { SDL_Finger *finger; diff --git a/src/events/SDL_touch_c.h b/src/events/SDL_touch_c.h index e46ba68197..db2d64b85f 100644 --- a/src/events/SDL_touch_c.h +++ b/src/events/SDL_touch_c.h @@ -42,9 +42,6 @@ extern bool SDL_TouchDevicesAvailable(void); // Add a touch, returning the index of the touch, or -1 if there was an error. extern int SDL_AddTouch(SDL_TouchID id, SDL_TouchDeviceType type, const char *name); -// Set or update the name of a touch. -extern void SDL_SetTouchName(SDL_TouchID id, const char *name); - // Get the touch with a given id extern SDL_Touch *SDL_GetTouch(SDL_TouchID id); diff --git a/src/video/wayland/SDL_waylandevents.c b/src/video/wayland/SDL_waylandevents.c index 8d59148111..d851eab2fd 100644 --- a/src/video/wayland/SDL_waylandevents.c +++ b/src/video/wayland/SDL_waylandevents.c @@ -1980,6 +1980,16 @@ static void keyboard_handle_key(void *data, struct wl_keyboard *keyboard, Wayland_UpdateImplicitGrabSerial(seat, serial); + if (state == WL_KEYBOARD_KEY_STATE_REPEATED) { + // If this key shouldn't be repeated, just return. + if (seat->keyboard.xkb.keymap && !WAYLAND_xkb_keymap_key_repeats(seat->keyboard.xkb.keymap, key + 8)) { + return; + } + + // SDL automatically handles key tracking and repeat status, so just map 'repeated' to 'pressed'. + state = WL_KEYBOARD_KEY_STATE_PRESSED; + } + if (seat->keyboard.sdl_keymap != SDL_GetCurrentKeymap(true)) { SDL_SetKeymap(seat->keyboard.sdl_keymap, true); SDL_SetModState(seat->keyboard.pressed_modifiers | seat->keyboard.locked_modifiers); @@ -2274,25 +2284,9 @@ static void seat_handle_capabilities(void *data, struct wl_seat *wl_seat, enum w static void seat_handle_name(void *data, struct wl_seat *wl_seat, const char *name) { SDL_WaylandSeat *seat = (SDL_WaylandSeat *)data; - char name_fmt[256]; if (name && *name != '\0') { seat->name = SDL_strdup(name); - - if (seat->keyboard.wl_keyboard) { - SDL_snprintf(name_fmt, sizeof(name_fmt), "%s (%s)", WAYLAND_DEFAULT_KEYBOARD_NAME, seat->name); - SDL_SetKeyboardName(seat->keyboard.sdl_id, name_fmt); - } - - if (seat->pointer.wl_pointer) { - SDL_snprintf(name_fmt, sizeof(name_fmt), "%s (%s)", WAYLAND_DEFAULT_POINTER_NAME, seat->name); - SDL_SetMouseName(seat->pointer.sdl_id, name_fmt); - } - - if (seat->touch.wl_touch) { - SDL_snprintf(name_fmt, sizeof(name_fmt), "%s (%s)", WAYLAND_DEFAULT_TOUCH_NAME, seat->name); - SDL_SetTouchName((SDL_TouchID)(uintptr_t)seat->touch.wl_touch, name_fmt); - } } } diff --git a/src/video/wayland/SDL_waylandvideo.c b/src/video/wayland/SDL_waylandvideo.c index a1b5276648..e9a97a98f1 100644 --- a/src/video/wayland/SDL_waylandvideo.c +++ b/src/video/wayland/SDL_waylandvideo.c @@ -74,14 +74,16 @@ #define WAYLANDVID_DRIVER_NAME "wayland" -// Clamp certain core protocol versions on older versions of libwayland. +// Clamp core protocol versions on older versions of libwayland. #if SDL_WAYLAND_CHECK_VERSION(1, 22, 0) #define SDL_WL_COMPOSITOR_VERSION 6 #else #define SDL_WL_COMPOSITOR_VERSION 4 #endif -#if SDL_WAYLAND_CHECK_VERSION(1, 22, 0) +#if SDL_WAYLAND_CHECK_VERSION(1, 24, 0) +#define SDL_WL_SEAT_VERSION 10 +#elif SDL_WAYLAND_CHECK_VERSION(1, 22, 0) #define SDL_WL_SEAT_VERSION 9 #elif SDL_WAYLAND_CHECK_VERSION(1, 21, 0) #define SDL_WL_SEAT_VERSION 8 @@ -95,6 +97,20 @@ #define SDL_WL_OUTPUT_VERSION 3 #endif +#if SDL_WAYLAND_CHECK_VERSION(1, 24, 0) +#define SDL_WL_SHM_VERSION 2 +#else +#define SDL_WL_SHM_VERSION 1 +#endif + +// The SDL libwayland-client minimum is 1.18, which supports version 3. +#define SDL_WL_DATA_DEVICE_VERSION 3 + +// wl_fixes was introduced in 1.24.0 +#if SDL_WAYLAND_CHECK_VERSION(1, 24, 0) +#define SDL_WL_FIXES_VERSION 1 +#endif + #ifdef SDL_USE_LIBDBUS #include "../../core/linux/SDL_dbus.h" @@ -456,6 +472,7 @@ static void Wayland_DeleteDevice(SDL_VideoDevice *device) typedef struct { bool has_fifo_v1; + struct wl_fixes *wl_fixes; } SDL_WaylandPreferredData; static void wayland_preferred_check_handle_global(void *data, struct wl_registry *registry, uint32_t id, @@ -466,6 +483,11 @@ static void wayland_preferred_check_handle_global(void *data, struct wl_registry if (SDL_strcmp(interface, "wp_fifo_manager_v1") == 0) { d->has_fifo_v1 = true; } +#ifdef SDL_WL_FIXES_VERSION + else if (SDL_strcmp(interface, "wl_fixes") == 0) { + d->wl_fixes = wl_registry_bind(registry, id, &wl_fixes_interface, SDL_min(SDL_WL_FIXES_VERSION, version)); + } +#endif } static void wayland_preferred_check_remove_global(void *data, struct wl_registry *registry, uint32_t id) @@ -492,6 +514,10 @@ static bool Wayland_IsPreferred(struct wl_display *display) WAYLAND_wl_display_roundtrip(display); + if (preferred_data.wl_fixes) { + wl_fixes_destroy_registry(preferred_data.wl_fixes, registry); + wl_fixes_destroy(preferred_data.wl_fixes); + } wl_registry_destroy(registry); if (!preferred_data.has_fifo_v1) { @@ -1261,7 +1287,7 @@ static void display_handle_global(void *data, struct wl_registry *registry, uint d->shell.xdg = wl_registry_bind(d->registry, id, &xdg_wm_base_interface, SDL_min(version, 7)); xdg_wm_base_add_listener(d->shell.xdg, &shell_listener_xdg, NULL); } else if (SDL_strcmp(interface, "wl_shm") == 0) { - d->shm = wl_registry_bind(registry, id, &wl_shm_interface, 1); + d->shm = wl_registry_bind(registry, id, &wl_shm_interface, SDL_min(SDL_WL_SHM_VERSION, version)); } else if (SDL_strcmp(interface, "zwp_relative_pointer_manager_v1") == 0) { d->relative_pointer_manager = wl_registry_bind(d->registry, id, &zwp_relative_pointer_manager_v1_interface, 1); } else if (SDL_strcmp(interface, "zwp_pointer_constraints_v1") == 0) { @@ -1315,6 +1341,11 @@ static void display_handle_global(void *data, struct wl_registry *registry, uint } else if (SDL_strcmp(interface, "wp_pointer_warp_v1") == 0) { d->wp_pointer_warp_v1 = wl_registry_bind(d->registry, id, &wp_pointer_warp_v1_interface, 1); } +#ifdef SDL_WL_FIXES_VERSION + else if (SDL_strcmp(interface, "wl_fixes") == 0) { + d->wl_fixes = wl_registry_bind(d->registry, id, &wl_fixes_interface, SDL_min(SDL_WL_FIXES_VERSION, version)); + } +#endif } static void display_remove_global(void *data, struct wl_registry *registry, uint32_t id) @@ -1549,7 +1580,11 @@ static void Wayland_VideoCleanup(SDL_VideoDevice *_this) } if (data->shm) { - wl_shm_destroy(data->shm); + if (wl_shm_get_version(data->shm) >= WL_SHM_RELEASE_SINCE_VERSION) { + wl_shm_release(data->shm); + } else { + wl_shm_destroy(data->shm); + } data->shm = NULL; } @@ -1634,6 +1669,11 @@ static void Wayland_VideoCleanup(SDL_VideoDevice *_this) } if (data->registry) { + if (data->wl_fixes) { + wl_fixes_destroy_registry(data->wl_fixes, data->registry); + wl_fixes_destroy(data->wl_fixes); + data->wl_fixes = NULL; + } wl_registry_destroy(data->registry); data->registry = NULL; } diff --git a/src/video/wayland/SDL_waylandvideo.h b/src/video/wayland/SDL_waylandvideo.h index e964731137..837df3e4a4 100644 --- a/src/video/wayland/SDL_waylandvideo.h +++ b/src/video/wayland/SDL_waylandvideo.h @@ -85,6 +85,7 @@ struct SDL_VideoData struct frog_color_management_factory_v1 *frog_color_management_factory_v1; struct wp_color_manager_v1 *wp_color_manager_v1; struct zwp_tablet_manager_v2 *tablet_manager; + struct wl_fixes *wl_fixes; struct xkb_context *xkb_context; diff --git a/wayland-protocols/wayland.xml b/wayland-protocols/wayland.xml index 10e039d6ec..bee74a1008 100644 --- a/wayland-protocols/wayland.xml +++ b/wayland-protocols/wayland.xml @@ -46,7 +46,7 @@ compositor after the callback is fired and as such the client must not attempt to use it after that point. - The callback_data passed in the callback is the event serial. + The callback_data passed in the callback is undefined and should be ignored. @@ -212,7 +212,7 @@ - + The wl_shm_pool object encapsulates a piece of memory shared between the compositor and client. Through the wl_shm_pool @@ -262,17 +262,17 @@ created, but using the new size. This request can only be used to make the pool bigger. - This request only changes the amount of bytes that are mmapped - by the server and does not touch the file corresponding to the - file descriptor passed at creation time. It is the client's - responsibility to ensure that the file is at least as big as - the new pool size. + This request only changes the amount of bytes that are mmapped + by the server and does not touch the file corresponding to the + file descriptor passed at creation time. It is the client's + responsibility to ensure that the file is at least as big as + the new pool size. - + A singleton global object that provides support for shared memory. @@ -419,6 +419,21 @@ + + + + + + + + + + + + + + + @@ -442,6 +457,17 @@ + + + + + + Using this request a client can tell the server that it is not going to + use the shm object anymore. + + Objects created via this interface remain unaffected. + + @@ -453,9 +479,11 @@ client provides and updates the contents is defined by the buffer factory interface. - If the buffer uses a format that has an alpha channel, the alpha channel - is assumed to be premultiplied in the color channels unless otherwise - specified. + Color channels are assumed to be electrical rather than optical (in other + words, encoded with a transfer function) unless otherwise specified. If + the buffer uses a format that has an alpha channel, the alpha channel is + assumed to be premultiplied into the electrical color channel values + (after transfer function encoding) unless otherwise specified. Note, because wl_buffer objects are created from multiple independent factory interfaces, the wl_buffer interface is frozen at version 1. @@ -473,8 +501,10 @@ Sent when this wl_buffer is no longer used by the compositor. - The client is now free to reuse or destroy this buffer and its - backing storage. + + For more information on when release events may or may not be sent, + and what consequences it has, please see the description of + wl_surface.attach. If a client receives a release event before the frame callback requested in the same wl_surface.commit that attaches this @@ -847,6 +877,7 @@ + @@ -868,7 +899,7 @@ The icon surface is an optional (can be NULL) surface that provides an icon to be moved around with the cursor. Initially, the top-left corner of the icon surface is placed at the cursor - hotspot, but subsequent wl_surface.attach request can move the + hotspot, but subsequent wl_surface.offset requests can move the relative position. Attach requests must be confirmed with wl_surface.commit as usual. The icon surface is given the role of a drag-and-drop icon. If the icon surface already has another role, @@ -876,6 +907,10 @@ The input region is ignored for wl_surfaces with the role of a drag-and-drop icon. + + The given source may not be used in any further set_selection or + start_drag requests. Attempting to reuse a previously-used source + may send a used_source error. @@ -889,6 +924,10 @@ to the data from the source on behalf of the client. To unset the selection, set the source to NULL. + + The given source may not be used in any further set_selection or + start_drag requests. Attempting to reuse a previously-used source + may send a used_source error. @@ -1411,7 +1450,7 @@ + summary="surface was destroyed before its role object"/> @@ -1440,9 +1479,9 @@ When the bound wl_surface version is 5 or higher, passing any non-zero x or y is a protocol violation, and will result in an - 'invalid_offset' error being raised. The x and y arguments are ignored - and do not change the pending state. To achieve equivalent semantics, - use wl_surface.offset. + 'invalid_offset' error being raised. The x and y arguments are ignored + and do not change the pending state. To achieve equivalent semantics, + use wl_surface.offset. Surface contents are double-buffered state, see wl_surface.commit. @@ -1467,7 +1506,8 @@ the delivery of wl_buffer.release events becomes undefined. A well behaved client should not rely on wl_buffer.release events in this case. Alternatively, a client could create multiple wl_buffer objects - from the same backing storage or use wp_linux_buffer_release. + from the same backing storage or use a protocol extension providing + per-commit release notifications. Destroying the wl_buffer after wl_buffer.release does not change the surface contents. Destroying the wl_buffer before wl_buffer.release @@ -1479,6 +1519,13 @@ If wl_surface.attach is sent with a NULL wl_buffer, the following wl_surface.commit will remove the surface content. + + If a pending wl_buffer has been destroyed, the result is not specified. + Many compositors are known to remove the surface content on the following + wl_surface.commit, but this behaviour is not universal. Clients seeking to + maximise compatibility should not destroy pending buffers and should + ensure that they explicitly remove content from surfaces, even after + destroying buffers. @@ -1618,16 +1665,18 @@ Surface state (input, opaque, and damage regions, attached buffers, etc.) is double-buffered. Protocol requests modify the pending state, - as opposed to the current state in use by the compositor. A commit - request atomically applies all pending state, replacing the current - state. After commit, the new pending state is as documented for each - related request. + as opposed to the active state in use by the compositor. - On commit, a pending wl_buffer is applied first, and all other state - second. This means that all coordinates in double-buffered state are - relative to the new wl_buffer coming into use, except for - wl_surface.attach itself. If there is no pending wl_buffer, the - coordinates are relative to the current surface contents. + A commit request atomically creates a content update from the pending + state, even if the pending state has not been touched. The content + update is placed in a queue until it becomes active. After commit, the + new pending state is as documented for each related request. + + When the content update is applied, the wl_buffer is applied before all + other state. This means that all coordinates in double-buffered state + are relative to the newly attached wl_buffers, except for + wl_surface.attach itself. If there is no newly attached wl_buffer, the + coordinates are relative to the previous content update. All requests that need a commit to become effective are documented to affect double-buffered state. @@ -1666,10 +1715,12 @@ - This request sets an optional transformation on how the compositor - interprets the contents of the buffer attached to the surface. The - accepted values for the transform parameter are the values for - wl_output.transform. + This request sets the transformation that the client has already applied + to the content of the buffer. The accepted values for the transform + parameter are the values for wl_output.transform. + + The compositor applies the inverse of this transformation whenever it + uses the buffer contents. Buffer transform is double-buffered state, see wl_surface.commit. @@ -1725,11 +1776,11 @@ a buffer that is larger (by a factor of scale in each dimension) than the desired surface size. - If scale is not positive the invalid_scale protocol error is + If scale is not greater than 0 the invalid_scale protocol error is raised. + summary="scale for interpreting buffer contents"/> @@ -1784,6 +1835,9 @@ x and y, combined with the new surface size define in which directions the surface's size changes. + The exact semantics of wl_surface.offset are role-specific. Refer to + the documentation of specific roles for more information. + Surface location offset is double-buffered state, see wl_surface.commit. @@ -1802,10 +1856,15 @@ This event indicates the preferred buffer scale for this surface. It is sent whenever the compositor's preference changes. + Before receiving this event the preferred buffer scale for this surface + is 1. + It is intended that scaling aware clients use this event to scale their content and use wl_surface.set_buffer_scale to indicate the scale they have rendered with. This allows clients to supply a higher detail buffer. + + The compositor shall emit a scale value greater than 0. @@ -1815,16 +1874,19 @@ This event indicates the preferred buffer transform for this surface. It is sent whenever the compositor's preference changes. - It is intended that transform aware clients use this event to apply the - transform to their content and use wl_surface.set_buffer_transform to - indicate the transform they have rendered with. + Before receiving this event the preferred buffer transform for this + surface is normal. + + Applying this transformation to the surface buffer contents and using + wl_surface.set_buffer_transform might allow the compositor to use the + surface buffer more efficiently. - + A seat is a group of keyboards, pointer and touch devices. This object is published as a global during start up, or when such a @@ -1852,9 +1914,10 @@ - This is emitted whenever a seat gains or loses the pointer, - keyboard or touch capabilities. The argument is a capability - enum containing the complete set of capabilities this seat has. + This is sent on binding to the seat global or whenever a seat gains + or loses the pointer, keyboard or touch capabilities. + The argument is a capability enum containing the complete set of + capabilities this seat has. When the pointer capability is added, a client may create a wl_pointer object using the wl_seat.get_pointer request. This object @@ -1936,9 +1999,9 @@ The same seat names are used for all clients. Thus, the name can be shared across processes to refer to a specific wl_seat global. - The name event is sent after binding to the seat global. This event is - only sent once per seat object, and the name does not change over the - lifetime of the wl_seat global. + The name event is sent after binding to the seat global, and should be sent + before announcing capabilities. This event only sent once per seat object, + and the name does not change over the lifetime of the wl_seat global. Compositors may re-use the same seat name if the wl_seat global is destroyed and re-created later. @@ -1957,7 +2020,7 @@ - + The wl_pointer interface represents one or more input devices, such as mice, which control the pointer location and pointer_focus @@ -1992,9 +2055,9 @@ where (x, y) are the coordinates of the pointer location, in surface-local coordinates. - On surface.attach requests to the pointer surface, hotspot_x + On wl_surface.offset requests to the pointer surface, hotspot_x and hotspot_y are decremented by the x and y parameters - passed to the request. Attach must be confirmed by + passed to the request. The offset must be applied by wl_surface.commit as usual. The hotspot can also be updated by passing the currently set @@ -2248,7 +2311,7 @@ - + Discrete step information for scroll and other axes. @@ -2370,10 +2433,20 @@ - + The wl_keyboard interface represents one or more keyboards associated with a seat. + + Each wl_keyboard has the following logical state: + + - an active surface (possibly null), + - the keys currently logically down, + - the active modifiers, + - the active group. + + By default, the active surface is null, the keys currently logically down + are empty, the active modifiers and the active group are 0. @@ -2408,10 +2481,18 @@ The compositor must send the wl_keyboard.modifiers event after this event. + + In the wl_keyboard logical state, this event sets the active surface to + the surface argument and the keys currently logically down to the keys + in the keys argument. The compositor must not send this event if the + wl_keyboard already had an active surface immediately before this event. + + Clients should not use the list of pressed keys to emulate key-press + events. The order of keys in the list is unspecified. - + @@ -2422,8 +2503,10 @@ The leave notification is sent before the enter notification for the new focus. - After this event client must assume that all keys, including modifiers, - are lifted and also it must stop key repeating if there's some going on. + In the wl_keyboard logical state, this event resets all values to their + defaults. The compositor must not send this event if the active surface + of the wl_keyboard was not equal to the surface argument immediately + before this event. @@ -2432,9 +2515,18 @@ Describes the physical state of a key that produced the key event. + + Since version 10, the key can be in a "repeated" pseudo-state which + means the same as "pressed", but is used to signal repetition in the + key event. + + The key may only enter the repeated state after entering the pressed + state and before entering the released state. This event may be + generated multiple times while the key is down. + @@ -2448,6 +2540,20 @@ If this event produces a change in modifiers, then the resulting wl_keyboard.modifiers event must be sent after this event. + + In the wl_keyboard logical state, this event adds the key to the keys + currently logically down (if the state argument is pressed) or removes + the key from the keys currently logically down (if the state argument is + released). The compositor must not send this event if the wl_keyboard + did not have an active surface immediately before this event. The + compositor must not send this event if state is pressed (resp. released) + and the key was already logically down (resp. was not logically down) + immediately before this event. + + Since version 10, compositors may send key events with the "repeated" + key state when a wl_keyboard.repeat_info event with a rate argument of + 0 has been received. This allows the compositor to take over the + responsibility of key repetition. @@ -2459,6 +2565,17 @@ Notifies clients that the modifier and/or group state has changed, and it should update its local state. + + The compositor may send this event without a surface of the client + having keyboard focus, for example to tie modifier information to + pointer focus instead. If a modifier event with pressed modifiers is sent + without a prior enter event, the client can assume the modifier state is + valid until it receives the next wl_keyboard.modifiers event. In order to + reset the modifier state again, the compositor can send a + wl_keyboard.modifiers event with no pressed modifiers. + + In the wl_keyboard logical state, this event updates the modifiers and + group. @@ -2497,7 +2614,7 @@ - + The wl_touch interface represents a touchscreen associated with a seat. @@ -2566,6 +2683,8 @@ currently active on this client's surface. The client is responsible for finalizing the touch points, future touch points on this surface may reuse the touch point ID. + + No frame event is required after the cancel event. @@ -2665,10 +2784,9 @@ - - This describes the transform that a compositor will apply to a - surface to compensate for the rotation or mirroring of an - output device. + + This describes transformations that clients and compositors apply to + buffer contents. The flipped values correspond to an initial flip around a vertical axis followed by rotation. @@ -2700,6 +2818,10 @@ The geometry event will be followed by a done event (starting from version 2). + Clients should use wl_surface.preferred_buffer_transform instead of the + transform advertised by this event to find the preferred buffer + transform to use for a surface. + Note: wl_output only advertises partial information about the output position and identification. Some compositors, for instance those not implementing a desktop-style output layout or those exposing virtual @@ -2722,7 +2844,7 @@ + summary="additional transformation applied to buffer contents during presentation"/> @@ -2795,8 +2917,9 @@ This event contains scaling geometry information that is not in the geometry event. It may be sent after binding the output object or if the output scale changes - later. If it is not sent, the client should assume a - scale of 1. + later. The compositor will emit a non-zero, positive + value for scale. If it is not sent, the client should + assume a scale of 1. A scale larger than 1 means that the compositor will automatically scale surface buffers by this amount @@ -2804,12 +2927,9 @@ displays where applications rendering at the native resolution would be too small to be legible. - It is intended that scaling aware clients track the - current output of a surface, and if it is on a scaled - output it should use wl_surface.set_buffer_scale with - the scale of the output. That way the compositor can - avoid scaling the surface, and the client can supply - a higher detail image. + Clients should use wl_surface.preferred_buffer_scale + instead of this event to find the preferred buffer + scale to use for a surface. The scale event will be followed by a done event. @@ -3035,6 +3155,11 @@ If the parent wl_surface object is destroyed, the sub-surface is unmapped. + + A sub-surface never has the keyboard focus of any seat. + + The wl_surface.offset request is ignored: clients must use set_position + instead to move the sub-surface. @@ -3060,9 +3185,7 @@ surface area. Negative values are allowed. The scheduled coordinates will take effect whenever the state of the - parent surface is applied. When this happens depends on whether the - parent surface is in synchronized mode or not. See - wl_subsurface.set_sync and wl_subsurface.set_desync for details. + parent surface is applied. If more than one set_position request is invoked by the client before the commit of the parent surface, the position of a new request always @@ -3085,9 +3208,7 @@ The z-order is double-buffered. Requests are handled in order and applied immediately to a pending state. The final pending state is copied to the active state the next time the state of the parent - surface is applied. When this happens depends on whether the parent - surface is in synchronized mode or not. See wl_subsurface.set_sync and - wl_subsurface.set_desync for details. + surface is applied. A new sub-surface is initially added as the top-most in the stack of its siblings and parent. @@ -3148,4 +3269,31 @@ + + + This global fixes problems with other core-protocol interfaces that + cannot be fixed in these interfaces themselves. + + + + + + + + + This request destroys a wl_registry object. + + The client should no longer use the wl_registry after making this + request. + + The compositor will emit a wl_display.delete_id event with the object ID + of the registry and will no longer emit any events on the registry. The + client should re-use the object ID once it receives the + wl_display.delete_id event. + + + + +