Apparently this _can_ happen under load, or maybe some other weird condition.
Hopefully this will encourage PipeWire to fire output_callback again, and
we'll just try again later.
Reference Issue #14916.
(cherry picked from commit 32ef82caaf)
- Initialize some out variables that are annotated inout in the function setting them.
- Fix 'dwVerHandle' might not be '0' warning from msvc analyzer calling GetFileVersionInfoA. MSDN says that
the lpdwHandle param to GetFileVersionInfoSize is optional (set to zero) and the dwHandle param to
GetFileVersionInfoA is ignored. msvc goes a step further and explicitly warns if dwHandle is not provably 0.
Fixes the following:
SDL3\src\stdlib\SDL_string.c(2359): warning C6054: String 'text' might not be zero-terminated.
SDL3\src\video\windows\SDL_windowsevents.c(897): warning C6001: Using uninitialized memory 'devName'.
SDL3\src\video\windows\SDL_windowskeyboard.c(644): warning C6388: 'dwVerHandle' might not be '0': this does not adhere to the specification for the function 'GetFileVersionInfoA'.
(cherry picked from commit b878ab1691)
Fixes#15285
Missing Metal GPU block in CMakeLists.txt prevents `HAVE_SDL_GPU` from being set when only Metal is enabled.
(cherry picked from commit e66f1b5162)
Now apps can have persistent files available during SDL_main()/SDL_AppInit()
and don't have to mess with Emscripten-specific code to prepare the filesystem
for use.
(cherry picked from commit dcc177faa4)
If the modern implementation of file dialogs on Windows fails, it will invoke the callback on error and report an error, then SDL would attempt invoking the dialog again using an older implementation, which would call the callback again.
This is not desired behavior, so it has been changed as follows:
- If the modern dialog fails before showing (missing library/symbol), don't call the callback and try the older dialogs in case we're on an old platform.
- If the dialog fails while or after showing, assume the error is a normal invocation error (such as an invalid path), call the callback and don't show the older dialogs to prevent showing two dialogs in succession to the user.
(cherry picked from commit a54dd7ba45)
Visual Studio _still_ doesn't report itself as C99 compatible, afaict, but
does support the syntax as of VS2017 15.6, apparently.
This page mentions the first version of Visual Studio that handles hexidecimal
float notation:
https://stackoverflow.com/questions/18180116/vc-rejecting-hexadecimal-floating-point-constant?utm_source=chatgpt.com
If not Visual Studio, we also take the messier path for things that don't
report themselves as C99. Most things will take the cleaner path, though.
Closes#15276.
(cherry picked from commit a157d96de8)
Caps the sample rate at 200kHz so that SDL's mixer will downsample any streams which are higher than that.
My Mega Drive emulator outputs at 223721Hz (the sample rate of the PSG chip), and `SDL_OpenAudioDeviceStream` fails due to DirectSound's `CreateSoundBuffer` returning an 'invalid parameter' error code. Lowering the sample rate makes the error go away.
Reported to me by @B3HKO in this issue:
https://github.com/Clownacy/clownmdemu-frontend/issues/60
The 200kHz limit is documented here:
https://learn.microsoft.com/en-us/previous-versions/windows/desktop/ee419022(v=vs.85)
DirectSound's Wikipedia article mentions that problems may occur with sample rates above 192kHz, but no source is provided, so I am unsure whether to take it seriously.
(cherry picked from commit 6efe0e19a7)
Fixes a crash when calling SDL_RenderGeometryRaw() with both `texture`
and `uv` set to `NULL`, and with geometry that is laid out in a way
that passes the quad checks.
(cherry picked from commit 989de77f4f)
When SIGCHLD is blocked, some executables (for example CMake) do not exit properly when executed using `SDL_CreateProcess` from any SDL thread (not main thread). `SDL_CreateProcessWithProperties` docs say that `SIGCHILD` should not be ignored or handled, therefore blocking it during thread creation is a likely reason for the bug. Should fix#15210.
Signed-off-by: Konstantin Tomashevich <konstantin.tomashevich@gmail.com>
(cherry picked from commit 291d1b6491)
When emulating display modes or using display scaling, custom cursors need to be scaled, or they can appear too large or small relative to the window size.
(cherry picked from commit 3d21b3bc68)
The SDL keyboard and mouse will be removed when destroying the seat, so there is no need to preemptively remove them.
(cherry picked from commit 566448d95a)
Technically we only want to do this for controllers that are opened, but we don't have a way to match up controllers using other APIs with individual GCControllers.
(cherry picked from commit 11adfd2008)
Some compositors will send a configure event immediately after a scale event, however, this event can contain the old logical size, and should be ignored, or the window will incorrectly change size when moved between displays with differing scale factors.
Store the last requested logical size as the last configure size when resizing a floating window due to a scale change, so a configure event immediately following with the old size will be ignored.
(cherry picked from commit 18219d5b53)
This PR makes the GameInput joystick backend ignore non-gamepad controllers if DirectInput or XInput backends are enabled. This is done to prevent possible bugs and/or regressions.
(cherry picked from commit 419dcfe747)
(This was corrected in main, but there isn't a clean cherry-pick we can do for
the release-3.4.x branch at this point, since various pieces of the sRGB work
made it in here in a different order, but this is the one crucial line that
appears to be missing.)
Reference Issue #14898.
This PR includes small improvements to the GameInput joystick backend:
- Device subtypes
- Compatibility with DirectInput joystick mappings (if the controller is not a gamepad, i.e. `GAMEINPUT_InternalIsGamepad()` returns `false`)
- Fallback to DirectInput/XInput for currently unsupported devices (force feedback ones and the ones that are neither gamepads nor controllers, I'm not sure if that's possible, but maybe racing wheels and other device subtypes would count?)
(cherry picked from commit 0138843eb7)