When using the libappindicator/gtk/unix Tray backend, the background
thread which calls gtk_main() is never destroyed. This means that we
detect a leaked thread as SDL_Quit().
Instead, tell gtk to shut down its main loop when no tray icons are
active. This fixes the issue here: SDL notices no leak, and repeatedly
creating / destroying tray icons seems to work fine.
Signed-off-by: David Gow <david@ingeniumdigital.com>
There are many recoverable errors that may happen internally and can be safely ignored if the public API doesn't return an error code. Seeing them causes lots of developer anxiety and they generally aren't helpful.
Fixes https://github.com/libsdl-org/SDL/issues/11813
This hint defaults on, enabling advanced controller features.
This replaces SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE and SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE, and is supported by PlayStation and Nintendo Switch controllers.
Fixes https://github.com/libsdl-org/SDL/issues/10086
If you're not using SDL for video you won't get raw input messages without this hint, and this is tripping up enough people it makes sense to have this enabled by default. There isn't much downside to this, other than having another thread processing Xbox controller input.
Fixes https://github.com/libsdl-org/SDL/issues/10576
Sometimes we'll get a Windows.Gaming.Input callback before the raw input device is even in the list, so try some other methods to better detect XInput devices.
The FORCEINLINE macro is also used by Windows SDK headers.
When it is an empty macro, FORCEINLINE-d functions will
get global visibility error and cause duplicate symbol link errors.
HRESULT_FROM_WIN32 is such a function.
On the Samsung Galaxy A52 the camera plane size is (pitch * (h - 1) + w) instead of (pitch * h). This led to us copying off the end of the plane when uploading the texture, so we pad out to our expected size.
Find the toplevel parent window, not the absolute highest toplevel window in the hierarchy, when positioning and adjusting the focus of popup windows.
Fixes a leftover case from when toplevel windows couldn't be parented to other toplevels.
Without it, programmatically resizing the window seems to fail. As popup windows are implicitly borderless, calculations taking the frame size into account need to be avoided.
GetClientRect() returns old, incorrect size data for popup windows when called while processing the WM_WINDOWPOSCHANGED message, so use the WINDOWPOS data instead.
Popups can't be maximized or fullscreen, so no need to worry about a move event resizing them.
Now (only in the generic backend, where it is implemented), this hint is
always respected. Previously it would only be used if no windows were created,
to help reduce CPU load on things like loopwave.
Since it's always used now, the default has changed from 60 (Hz) to 0 (run as
fast as possible). Things like loopwave should still likely force this way
lower than the previous default (and already do: loopwave explicitly sets it
to 5).
The hint can now also be set to "waitevent" which will cause SDL_AppIterate
to only be called after new events have arrived, for apps that are entirely
driven by input and want to consume (almost) no power or CPU time until then.
Fixes#11093.
Fixes#11387.