Alter the video driver grab/confinement function signatures to return an int, set and return an error if the grab request fails, and clear the grab flags from the window if the mouse and/or keyboard wasn't actually grabbed.
This merges mainstream commit
4f2e91bae8
(authored by Vladimir Gladkov) into ours. From the original commit log:
Win32 HID API doc says: For USB devices, the maximum string length is
126 wide characters (not including the terminating NULL character).
For certain USB devices, using a buffer larger or equal to 127 wchars
results in successful completion of HID API functions, but a broken
string is stored in the output buffer. This behaviour persists even if
HID API is bypassed and HID IOCTLs are passed to the HID driver directly
(IOCTL_HID_GET_MANUFACTURER_STRING, IOCTL_HID_GET_PRODUCT_STRING, etc).
So, the buffer MUST NOT exceed 126 wchars.
windows: refactor ULONGLONG hid_internal_get_info(...) ->
hid_internal_detect_bus_type_result hid_internal_detect_bus_type(...)
hid_internal_detect_bus_type is now only responsible for detection of
the bus type; rename it accordingly. Also, mixing an internal flag and
DEV_INST into an ULONGLONG retval feels kinda hackish; use a cleaner
approach instead (add an internal flag to help distinguishing between
BLUETOOTH and BLE devices, then clear it once we are done).
The AVHWFramesContext associated with the frame has the texture size, and the frame width and height are the displayed size and can be smaller than the texture size
Other flags may have been set when programmatically hiding a window, so or in the fullscreen and maximized flags to avoid accidentally clearing any others.
If the `EGL_EXT_image_dma_buf_import_modifiers` extension is available, propagate the DRM format modifier from the AVDRMObjectDescriptor to eglCreateImage() on Linux. Some hardware will decode video into a non-linear DRM surface, and passing the DRM format modifier to eglCreateImage() is required in order to display something useful.
Fixes https://github.com/libsdl-org/SDL/issues/9075
The window manager might hide/unmap the window when it is minimized, in which case the fullscreen and maximized flags must be preserved as pending flags so the window will be restored to the proper state when shown/mapped on restoration.
We were accidentally skipping all of the mappings that used the SDL_GAMECONTROLLER_USE_BUTTON_LABELS hint, because they used the '!' negate operator with a default hint value of 1. Instead we just want to use that hint to determine whether the mapping has positional buttons or not, and swap the buttons as needed.
Fixes https://github.com/libsdl-org/SDL/issues/9190
This uses the same chipset as the DragonRise Inc. Generic USB Joystick, which many manufacturers use for different products with different mappings.
In order to add a mapping for a controller using this chipset, we need a unique crc for the device name.