X11 mouse weirdness

I’ve had this on and off for a few months – I’ve seen some bizarre
core dumps.

XListInputDevices seems to be a strange function – the specication doesn’t
really deal with what happens if there is no devices, but I figured this
out by runtime inspection. (I didn’t audit the source).

Index: SDL_x11mouse.c===================================================================
— SDL_x11mouse.c (revision 4301)
+++ SDL_x11mouse.c (working copy)
@@ -63,6 +63,12 @@
/* we’re getting the list of input devices */
DevList = XListInputDevices(display, &n);

  • /* this is strange, – DevList could be null by n is > 0 –
  • * is DevList is NULL, make n 0.
    
  • */
    
  • if(DevList == NULL)
  •   n = 0;
    
  • /* we’re aquiring valuators: mice, tablets, etc. /
    for (i = 0; i < n; ++i) {
    /
    if it’s the core pointer or core keyborard we don’t want it */

marty

I’ve had this on and off for a few months – I’ve seen some bizarre
core dumps.

XListInputDevices seems to be a strange function – the specication doesn’t
really deal with what happens if there is no devices, but I figured this
out by runtime inspection. (I didn’t audit the source).

I checked in a different fix in revision 4316, can you see if it works?

Thanks!
-Sam Lantinga, Founder and President, Galaxy Gameworks LLC