This scenario can occur, for example, when the 4-finger touch sequence is used to switch spaces. the SDL window does not receive the touch up events and ends up thinking there are far more fingers on the pad than there are.
So the solution here is everytime a new "touch" appears we can through and check if there are any existing known touches by the OS and if there are none, abut SDL things there are, we simply go through and cancel the SDL touches.
Side affects.
- the "touch up" won't occur until the users sends a new touch (could be well after the actual release really did occur)
Windows Phone 8.0 either did not define, or provide access to, a 'RoamingFolder'
or 'TemporaryFolder' for apps to use. Windows 8.0 and 8.1 do, as does
Windows Phone 8.1. This change allows SDL-based Windows Phone 8.1 apps to
access these folders, via either the SDL_WinRTGetFSPathUNICODE() or
SDL_WinRTGetFSPathUTF8() functions.
SDL_GetPrefPath(), which on WinRT, is based on SDL_WinRTGetFSPathUTF8(), will
continue to return the app's 'local' folder, despite Windows 8.x
counterpart apps using the 'roaming' folder, in order to preserve compatibility
when 8.0-based Phone apps upgrade to 8.1-based Phone apps.
This patch makes sure that any SDL_MOUSEBUTTONDOWN, SDL_MOUSEBUTTONUP, and
SDL_MOUSEMOTION events, as triggered by a touch event in a WinRT app, set the
event's 'which' field to SDL_TOUCH_MOUSEID. Previously, this was getting set
to the same value as events from a real mouse, '0'.
Thanks to Diego for providing information on this bug, and to Tamas Hamor for
sending over a patch!
The crash would occur when a WinRT app explicitly tried to create an
SDL_Renderer using the "opengles2" renderer (via SDL_HINT_RENDER_DRIVER), but
OpenGL ES 2 / ANGLE .dlls weren't packaged in the app.
The "future-dev" branch of MSOpenTech's ANGLE/WinRT repository (at
https://github.com/msopentech/angle) includes support for Windows Phone 8.1.
This change allows it to be used in conjunction with SDL's OpenGL functions.
ANGLE for WinRT has at least two versions:
- an older version, which supports Windows 8.0 and 8.1. This is currently
the "winrt" branch in MSOpenTech's ANGLE repository (at
https://github.com/msopentech/angle)
- a newer version, which drops support for Windows 8.0, but is under more
active development (via MSOpenTech's "future-dev" branch), and which was
recently merged into the ANGLE project's official "master" branch
(at https://chromium.googlesource.com/angle/angle)
Both versions are setup using slightly different APIs. SDL/WinRT will now
attempt to detect which version is being used, and configure it appropriately.
The script was originally written for an SDL_gamecontrollerdb.h which had groups
of mappings separated by single lines starting with a "#". This was changed some
time ago to #endif/#if pairs. Because the script assumed only a single #endif in
the whole file it no longer worked correctly and only processed the first group.
The return value of SDL_malloc() was not checked and NULL therefore not handled.
Also added setting of error message for the other SDL_malloc() in this function.
Nitz
Variable entry going out of scope leaks the storage it points to, at:
/* Need to add a hint entry for this watcher */
hint = (SDL_Hint *)SDL_malloc(sizeof(*hint));
if (!hint) {
return;
}
Patch is attached.
The return value of SDL_malloc() was not checked and NULL therefore not handled.
NULL returned by SDL_GameControllerMapping()/SDL_GameControllerMappingForGUID()
now either means "no mapping" (as before) or "no memory" (just crashed before).
For consistency with the similar functions getting SDL_GameController as input.
Also NULL is no SDL_GameController and therefore can not have a mapping anyway.
- made keycode listings a bit easier to read
- listed VK_ keycode names, where appropriate
- removed a few pieces of dead + commented-out code
- applied a common 'WINRT_' prefix to internal function names