The AAudio driver implemented pause/resume by dangerously locking the audio devices. If there was an audio hotplug event or a background thread tried to interact with the audio system, this could cause deadlocks.
0500b30c550900001472000001000000 is the ID when the controller is connected via Bluetooth and 0300b30c550900001472000011010000 is for USB mode.
Tested by setting "SDL_GAMECONTROLLERCONFIG" in some games.
Removed duplicate hints SDL_HINT_APP_NAME, SDL_HINT_APP_ID, and
SDL_HINT_AUDIO_DEVICE_APP_NAME.
Wired up a few things to use the metadata; more to come!
Fixes https://github.com/libsdl-org/SDL/issues/4703
If someone calls SDL_Quit(), then runs an SDL function that implicitly initializes TLS or logging, and then calls SDL_Quit() again, we want to make sure we run through the quit process again. Each of the Init/Quit calls are protected against being called multiple times.
The supported texture formats were leaking. In order to catch future issues, we'll just do a full teardown of the renderer in the failure case, and make sure it's safe to do so with a partially initialized renderer.
It was intended to make the API easier to use, but various automatic garbage collection all had flaws, and making the application periodically clean up temporary memory added cognitive load to using the API, and in many cases was it was difficult to restructure threaded code to handle this.
So, we're largely going back to the original system, where the API returns allocated results and you free them.
In addition, to solve the problems we originally wanted temporary memory for:
* Short strings with a finite count, like device names, get stored in a per-thread string pool.
* Events continue to use temporary memory internally, which is cleaned up on the next event processing cycle.
Whoever provided the window has already set it up the way they want it.
Fixes SDL removing iconified or maximized state when creating a window from an existing OS window.
Move the Wayland pointer warp emulation code up to the SDL mouse layer, and activate it when a client attempts to warp a hidden mouse cursor when the hint is set.
testrelative adds the ability to test the warp emulation activation/deactivation with the --warp parameter and 'c' key for toggling cursor visibility.
When the phone is in portrait mode and the window is in landscape mode, the view changes orientation after layoutSubviews runs. In this case we need some way of notifying the application that the Metal view has changed.
On iOS, the application gets one last change to process messages before going into the background. We do the same on Android, which more closely matches the previous behavior.
This change also decouples the pause/resume handling from the video subsystem on Android, so applications that don't use SDL for video can get application life cycle events.
The semantics for the life cycle events are that they need to be handled in an event watch callback, and once they've been delivered, the application will block until it's been resumed. SDL_HINT_ANDROID_BLOCK_ON_PAUSE can be used to control that behavior, and if that's set to "0", then the application will continue to run in the background at low CPU usage until being resumed or stopped.
SDL_HINT_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO has been removed, and the audio will be paused when the application is paused.
Fixes https://github.com/libsdl-org/SDL/issues/3193
This makes it more clear that these events can't be handled in the normal event loop. It also makes pause and resume transparent to applications that don't handle them, which is a nice side effect.