Thu, 17 Apr 2014 20:18:50 -0700Fixed bug 2477 - [PATCH] Joysticks do not work on RHEL6/CentOS6 systems
Sam Lantinga <slouken@libsdl.org> [Thu, 17 Apr 2014 20:18:50 -0700] rev 8709
Fixed bug 2477 - [PATCH] Joysticks do not work on RHEL6/CentOS6 systems

Ashley Whetter

RHEL6 and CentOS6 systems still use an old version of udev (147). It wasn't until udev 148 (Yep. 1 version off!) that the input class system changed from "ID_CLASS" to "ID_INPUT_{JOYSTICK,KEYBOARD,MOUSE,etc}" (http://lwn.net/Articles/364728/). Because SDL2 looks for the ID_INPUT_X field this means that it never detects any input devices on RHEL6 systems.

I've attached a patch which fixes the problem. If no input devices are detected with "ID_INPUT_X" then SDL will fallback to looking for the old style "ID_CLASS" udev field instead.
Because of the "big change" between udev versions I doubt it'll ever get upgraded on RHEL6, but because RHEL7 is on the way I don't know if this patch is worth merging. Hopefully it'll help anyone out that's having this problem though.

Thu, 17 Apr 2014 20:15:44 -0700Fixed window losing the SDL_WINDOW_FOREIGN flag if something tries to recreate it.
Sam Lantinga <slouken@libsdl.org> [Thu, 17 Apr 2014 20:15:44 -0700] rev 8708
Fixed window losing the SDL_WINDOW_FOREIGN flag if something tries to recreate it.

Thu, 17 Apr 2014 20:06:02 -0700Fixed bug 2086 - valgrind memory not released
Sam Lantinga <slouken@libsdl.org> [Thu, 17 Apr 2014 20:06:02 -0700] rev 8707
Fixed bug 2086 - valgrind memory not released

Sylvain

Someone provided a patch for this, recently on the mailing list :
-----

Hi,

it is possible to skip the bug in libX11 by using the defaults for
XNResourceName and XNResourceClass in `XCreateIC' (the table for the
"Input Context Values" [1] in libX11-doc shows that a default is
provided if it is not set).

diff -ur SDL2-2.0.3~/src/video/x11/SDL_x11window.c SDL2-2.0.3/src/video/x11/SDL_x11window.c
--- SDL2-2.0.3~/src/video/x11/SDL_x11window.c 2014-04-04 17:09:40.764307181 +0200
+++ SDL2-2.0.3/src/video/x11/SDL_x11window.c 2014-04-04 17:10:23.887765046 +0200
@@ -239,8 +239,7 @@
data->ic =
X11_XCreateIC(videodata->im, XNClientWindow, w, XNFocusWindow, w,
XNInputStyle, XIMPreeditNothing | XIMStatusNothing,
- XNResourceName, videodata->classname, XNResourceClass,
- videodata->classname, NULL);
+ NULL);
}
#endif
data->created = created;


Tito Latini

[1] http://www.x.org/releases/X11R7.7-RC1/doc/libX11/libX11/libX11.html#Input_Context_Values

Thu, 17 Apr 2014 20:02:11 -0700Fixed bug 2502 - Memory leak inside SDL_x11events.c -> X11_DispatchEvent(_THIS)
Sam Lantinga <slouken@libsdl.org> [Thu, 17 Apr 2014 20:02:11 -0700] rev 8706
Fixed bug 2502 - Memory leak inside SDL_x11events.c -> X11_DispatchEvent(_THIS)

bojko_1000

Code @566:
if (data->xwindow) {
Atom _net_frame_extents = X11_XInternAtom(display, "_NET_FRAME_EXTENTS", 0);
Atom type = None;
int format;
unsigned long nitems = 0, bytes_after;
unsigned char *property;
X11_XGetWindowProperty(display, data->xwindow,
_net_frame_extents, 0, 16, 0,
XA_CARDINAL, &type, &format,
&nitems, &bytes_after, &property);

if (type != None && nitems == 4)
{
border_left = ((long*)property)[0];
border_right = ((long*)property)[1];
border_top = ((long*)property)[2];
border_bottom = ((long*)property)[3];
}
}

Code after _the fix_:
if (data->xwindow) {
Atom _net_frame_extents = X11_XInternAtom(display, "_NET_FRAME_EXTENTS", 0);
Atom type = None;
int format;
unsigned long nitems = 0, bytes_after;
unsigned char *property;
X11_XGetWindowProperty(display, data->xwindow,
_net_frame_extents, 0, 16, 0,
XA_CARDINAL, &type, &format,
&nitems, &bytes_after, &property);

if (type != None && nitems == 4)
{
border_left = ((long*)property)[0];
border_right = ((long*)property)[1];
border_top = ((long*)property)[2];
border_bottom = ((long*)property)[3];
}
X11_XFree(property);
}

I have found that leak with valgrind.

Thu, 17 Apr 2014 19:52:15 -0700Fixed bug 2503 - Loop indexing and event union errors in SDL_gesture.c
Sam Lantinga <slouken@libsdl.org> [Thu, 17 Apr 2014 19:52:15 -0700] rev 8705
Fixed bug 2503 - Loop indexing and event union errors in SDL_gesture.c

Lasse Öörni

While enabling $1 gesture support in the Urho3D engine which uses SDL2 I detected some errors in the gesture code in SDL_gesture.c:

- In the function SDL_SaveAllDollarTemplates() the following line should use index variable j instead of i:

rtrn += SaveTemplate(&touch->dollarTemplate[i], dst);

- In the function SDL_SaveDollarTemplate() the following code should use index variable j instead of i:

if (touch->dollarTemplate[i].hash == gestureId) {
return SaveTemplate(&touch->dollarTemplate[i], dst);

- In the function SDL_SendGestureDollar() the x & y coordinates are being written to the mgesture structure, which results in garbage due to dgesture and mgesture being different data structures inside the union. The coordinates should be written to dgesture.x & dgesture.y respectively

Thu, 17 Apr 2014 17:24:27 -0700Updated configure with Brandon Schaefer's changes
Sam Lantinga <slouken@libsdl.org> [Thu, 17 Apr 2014 17:24:27 -0700] rev 8704
Updated configure with Brandon Schaefer's changes

Thu, 17 Apr 2014 14:02:21 -0700Add DIRECTFB_CFLAGS to SDL_CFLAGS so its cflags will get added to the sdl2.pc
Brandon Schaefer <brandon.schaefer@canonical.com> [Thu, 17 Apr 2014 14:02:21 -0700] rev 8703
Add DIRECTFB_CFLAGS to SDL_CFLAGS so its cflags will get added to the sdl2.pc

Thu, 17 Apr 2014 13:58:39 -0700Add MIR_CFLAGS to SDL_CFLAGS so these cflags are added to the sdl2.pc file.
Brandon Schaefer <brandon.schaefer@canonical.com> [Thu, 17 Apr 2014 13:58:39 -0700] rev 8702
Add MIR_CFLAGS to SDL_CFLAGS so these cflags are added to the sdl2.pc file.

Thu, 17 Apr 2014 12:43:51 -0400WinRT: keyboard VirtualKey translation improvements from Sylvain Becker
David Ludwig <dludwig@pobox.com> [Thu, 17 Apr 2014 12:43:51 -0400] rev 8701
WinRT: keyboard VirtualKey translation improvements from Sylvain Becker

Changes included:
- adding support for a few, additional, VirtualKey constants
- removing accesses to 'windows_scancode_table', as the table's contents
don't line up with WinRT virtual keys. Using Windows older VK_* constants
may, however, be a good alternative in a future update.

Thu, 17 Apr 2014 12:44:08 -0300Comment out eglWaitGL from Android_GLES_SwapWindow
Gabriel Jacobo <gabomdq@gmail.com> [Thu, 17 Apr 2014 12:44:08 -0300] rev 8700
Comment out eglWaitGL from Android_GLES_SwapWindow

Let's hope for the best! If anyone has a device affected by this removal,
please file a bug!