Fixes CMake not being able to find X11 on FreeBSD (which generally has the
headers in /usr/local/include/X11).
List of other popular places borrowed from CMake's FindX11 module.
This worked on the configure script because of magic in the AC_PATH_X macro.
Fixes Bugzilla #4815.
"Applications (such as SDL's testgesture) do "event.tfinger.x * window_width"
to find window coord. Currently the X11 XInput2 backend expects application
to do "event.tfinger.x * (window_width-1)" instead.
X11 XInput2 touch events are normalized so x is 1.0 at "width - 1" but other
SDL backends appear to have x be 1.0 at "width". Same issue for touch event
y with regards to height."
Fixes Bugzilla #4183.
If we change the current context behind the app's back, those tracking
the current context to minimize context changes are going to get
confused.
This brings the EGL backend in line with the GLX one.
Fixes Bugzilla #4199.
This was reproducible by running an SDL app on the console from an ssh login. In this case the terminal wasn't owned by the user running the app, so we were using the default keymap, which didn't have state transitions defined for ctrl and alt, so once we entered that state keypresses would no longer transition out of that state, nor would they generate text.
As a workaround, we'll just reset to the default shift state if that happens, which means we'll get text for keys pressed while ctrl is held down, but I don't think that's a big problem.
Note that in this case we also can't mute the keyboard, so the keypresses go to the console, which probably isn't what you want...
SDL_ExitProcess(), SDL_AbortAssertion() and SDLTest_BailOut().
(Commit 303c1e0fb0cf for bug #4100 removed SDL_NORETURN from
SDL_ExitProcess() and SDL_AbortAssertion() in order to avoid
warnings from windows builds, but that's temporary I guess..)
These are entirely untested
Several USB ids refer to multiple packaged products. In those cases I tried to use the most common name, or a general name (e.g. PS3 Controller), or a completely generic name (e.g. USB gamepad) if it wasn't clear what type of controller it was.
Patches welcome!
Expand SDLActivity::SDLSurface::surfaceChanged() callback to grab the panel width and height at the same time and pass that along to the native code. Only works on API 17+. Duplicates surface dimensions whenever it fails.
Add Android_DeviceWidth/Android_DeviceHeight globals to native code.
Disambiguate Android_ScreenWidth/Android_ScreenHeight -> Android_SurfaceWidth/Android_SurfaceHeight
Use device width/height for all display mode settings.
This means we have to consider SDL_WINDOW_MINIMIZED a window creation flag, but on non-windows platforms we just remove it and let the normal FinishWindowCreation re-apply and do the minimize as I have no idea what is right on them or if anything should change.
CR: Phil
Martin ?irokov
Launching an SDL application with SDL_AUDIODRIVER=jack, and then calling SDL_OpenAudioDevice() with whatever parameters fails with an error like this one:
SDL_OpenAudioDevice: Couldn't connect JACK ports: SDL:sdl_jack_output_0 => system:midi_playback_1
This happens because JACK_OpenDevice in src/audio/jack/SDL_jackaudio.c blindly tries to connect to all input ports without checking whether they are for audio or midi.
The fix is to check port types and ignore all non audio ports. Also I removed devports field from struct SDL_PrivateAudioData, because it's never really used and removing unused ports from it would be PITA.
Jona
The following explains why this bug was happening:
This crash was caused because the audio session was being set as active [session setActive:YES error:&err] when the audio device was actually being CLOSED. Certain cases the audio session being set to active would fail and the method would return right away. Because of the way the error was handled we never removed the SDLInterruptionListener thus leaking it. Later when an interruption was received the THIS_ object would contain a pointer to an already released device causing the crash.
The fix:
When only one device remained open and it was being closed we needed to set the audio session as NOT active and completely ignore the returned error to successfully release the SDLInterruptionListener. I think the user assumed that the open_playback_devices and open_capture_devices would equal 0 when all of them where closed but the truth is that at the end of the closing process that the open devices count is decremented.
(It gets upset at the -2147483648, thinking this should be an unsigned value
because 2147483648 is too large for an int32, so the negative sign upsets the
compiler.)
The concern is that a massive int sample, like 0x7FFFFFFF, won't fit in a
float32, which doesn't have enough bits to hold a whole number this large,
just to divide it to get a value between 0 and 1.
Previously we would convert to double, to get more bits, do the division, and
cast back to a float, but this is expensive.
Casting to double is more accurate, but it's 2x to 3x slower. Shifting out
the least significant byte of an int32, so it'll definitely fit in a float,
and dividing by 0x7FFFFF is still accurate to about 5 decimal places, and the
difference doesn't appear to be perceptable.
Fixes problems launching Firewatch on Linux (which statically links SDL but
also dynamically loads a system-wide copy from a plugin shared library) with
a newer SDL build.
The change makes sure that SDL_vsnprintf() nul terminates if it is
using _vsnprintf() for the job.
I made this patch for Watcom, whose _vsnprintf() doesn't guarantee
nul termination. The preprocessor check can be extended to windows
in general too, if required.
Closes bug #3769.