Viewports decouple the buffer from the window size and avoids the window geometry hacks used to prevent problems if a buffer with an old size in the pipeline ends up being committed.
Fixes an invalid geometry warning and incorrect overview size for fullscreen windows on GNOME, and avoids flicker when entering/exiting fullscreen or moving the window between scaled and non-scaled displays.
This commit fixes the attribute list in the WGL and GLX code when requesting a floating point pixel format. The name of the attribute was missing in the list.
Fixes libsdl-org#10189
(cherry picked from commit 9389712917)
Add a loop around SDL_hid_read() in the Steam Deck HIDAPI driver as it
is done in other HIDAPI drivers. This loop reads data from the device and
processes it until the input buffer is empty which ensures that clients
always get the latest data.
This fixes an input latency issue if the application polls the events
slower than the hardware generates them.
This reverts commit 9f8dffbd2d.
This causes some tests to fail, and wasn't otherwise a necessary change, so
I'm backing it out.
(Looks like some sort of interaction with software renderers and their
surfaces not getting destroyed...?)
(cherry picked from commit f9a06c20ed)
This allows apps to destroy the window and renderer in either order, but
makes sure that the renderer can properly clean up its resources while OpenGL
contexts and libraries are still loaded, etc.
If the window is destroyed first, the renderer is (mostly) destroyed but its
pointer remains valid. Attempts to use the renderer will return an error,
but it can still be explicitly destroyed, at which time the struct is free'd.
If the renderer is destroyed first, everything works as before, and a new
renderer can still be created on the existing window.
Fixes#10174.
(cherry picked from commit cab3defc18)
Previously, each backend would allocate and free the renderer struct. Now
the higher level does it, so the backends only manage their private resources.
This removes some boilerplate and avoids some potential accidents.
(Manually cherry-picked from 39c8434f5f)
Reference Issue #10174.
Steam ran into a crash SDL_XINPUT_JoystickDetect() with XINPUTGETCAPABILITIES being NULL. I'm not sure how that happened, and there may still be a race condition if this is a multi-threaded issue, but at least this is more correct.
(cherry picked from commit 0ae4fd0ec9)
In the stdcpp thread implementation, the allocated std::thread objects were never deleted after joining/detaching
(cherry picked from commit 20dbe90771)
Proton uses this on Linux to determine what the XInput slot is for the gamepad. Other applications will get the real controller name and VID/PID by virtue of the code in SDL_steam_virtual_gamepad.c
(cherry picked from commit 361cae0874)
I _did_ appreciate the explanation, but it doesn't have to live in the
source code; also we can just release `devuid` and then check for error with
the usual macro, since SDL is done with it either way at this point.
(cherry picked from commit 17af09f3a9)
When they are in simple report mode, the thumbstick gets turned into a digital hat, so let's use them in full report mode.
(cherry picked from commit bf27269952)
This fixes numerous problems regarding dead keys on Wayland. Most
notably, Wayland was enforcing dead keys on SDL_KEYDOWN and SDL_KEYUP
events, which caused unresponsiveness on keys that were mapped to dead
keys (tilde on US-Intl is most notable for this, commonly used as a
console key).
When starting text input, not all state was reset properly. The text
input protocol requires to be re-enabled every time text input changes,
which SDL did not do. Also, XKB compose state was not reset at all,
causing composite and dead keys to carry over from when text input was
disabled.