Ensure that references to the clipboard being held by other seats are cleared when new data is being set, or some seats may hold references to invalid data and callbacks.
Sending a nil selection followed by immediately destroying the selection offer is redundant, and avoiding intermediate nil offers helps some clipboard managers avoid potential race conditions.
The clipboard code often had excessive and unnecessary error checking (e.g. checking if the video backed was initialized, when there is no way that path would be hit if it wasn't), overly complicated some operations, and had several cases where things can be C99-ified. Clean things up a bit to make it easier to read and debug.
Note that we don't account for vertex color here. If HDR10 content needs to be tinted by vertex color, it can't use the simple shader. I'm assuming that the use case for this will be video content which generally won't use vertex color and this optimization is fine.
If the previous selection offering was recursive, a nil selection should be ignored, or clearing the clipboard may clear the backing memory of the client's selection offering as well.
The warp event in Wayland can occur without explicitly warping the mouse, such as if a window changes position under the cursor while the cursor is stationary. Introduce the internal SDL_SendMouseWarp() function to handle updating the absolute cursor position without generating relative motion for these cases.
Explicit version checks require application manifests on Win10, or an older version will be reported. Check for the toast notification history interface, which is only available on Win10+, and use that to determine if the Windows version is high enough to support notifications.
The wl_fixes.ack_global_remove request signals the compositor that the
client will not bind the removed global. It can be used by the
compositor to decide when it is safe to actually destroy the
corresponding global. If a global is destroyed too soon, some clients may
get disconnected.
See also https://gitlab.freedesktop.org/wayland/wayland/-/merge_requests/533
Some window managers will mark minimized or offscreen windows as unmapped. When hiding a window, unconditionally call XWithdrawWindow, and don't wait for an UnmapNotify event if the window is already in the unmapped state, or it will block indefinitely waiting for an event that never arrives.
v2 removes v1's strict ordering requirement (decoration object must be created and configured before any buffer is attached), allowing xdg_toplevel_decoration to be created even after a buffer has already been attached/committed
The PS3 probing switches the HORI Horipad Mini into Nintendo Switch report mode, which we don't recognize since it's still using the Xbox 360 endpoint.
Generate activation tokens for new windows when necessary, and check the hint for activating windows when shown. This will allow new windows to correctly take focus in environments with elevated focus stealing prevention when possible, and it will try to prevent new windows from being activated if the hint is set to false.