--- SDL-1.2.15/configure	Thu Jan 19 07:30:12 2012
+++ SDL-1.2.15/configure	Fri May  3 17:39:02 2019
@@ -30190,7 +30190,7 @@
 if test x$have_cdrom != xyes; then
     if test x$enable_cdrom = xyes; then
         cat >>confdefs.h <<\_ACEOF
-#define SDL_CDROM_DISABLED 1
+#define SDL_CDROM_DUMMY 1
 _ACEOF
 
     fi
--- SDL-1.2.15/include/SDL_config.h	Thu Jan 19 07:30:30 2012
+++ SDL-1.2.15/include/SDL_config.h	Fri May  3 19:20:14 2019
@@ -1,3 +1,4 @@
+/* include/SDL_config.h.  Generated from SDL_config.h.in by configure.  */
 /*
     SDL - Simple DirectMedia Layer
     Copyright (C) 1997-2012 Sam Lantinga
@@ -23,23 +24,290 @@
 #ifndef _SDL_config_h
 #define _SDL_config_h
 
+/* This is a set of defines to configure the SDL features */
+
+/* General platform specific identifiers */
 #include "SDL_platform.h"
 
-/* Add any platform that doesn't build using the configure system */
-#if defined(__DREAMCAST__)
-#include "SDL_config_dreamcast.h"
-#elif defined(__MACOS__)
-#include "SDL_config_macos.h"
-#elif defined(__MACOSX__)
-#include "SDL_config_macosx.h"
-#elif defined(__SYMBIAN32__)
-#include "SDL_config_symbian.h"  /* must be before win32! */
-#elif defined(__WIN32__)
-#include "SDL_config_win32.h"
-#elif defined(__OS2__)
-#include "SDL_config_os2.h"
+/* Make sure that this isn't included by Visual C++ */
+#ifdef _MSC_VER
+#error You should copy include/SDL_config.h.default to include/SDL_config.h
+#endif
+
+/* C language features */
+/* #undef const */
+/* #undef inline */
+/* #undef volatile */
+
+/* C datatypes */
+/* #undef size_t */
+/* #undef int8_t */
+/* #undef uint8_t */
+/* #undef int16_t */
+/* #undef uint16_t */
+/* #undef int32_t */
+/* #undef uint32_t */
+/* #undef int64_t */
+/* #undef uint64_t */
+/* #undef uintptr_t */
+#define SDL_HAS_64BIT_TYPE 1
+
+/* Endianness */
+#define SDL_BYTEORDER 4321
+
+/* Comment this if you want to build without any C library requirements */
+#define HAVE_LIBC 1
+#if HAVE_LIBC
+
+/* Useful headers */
+#define HAVE_ALLOCA_H 1
+#define HAVE_SYS_TYPES_H 1
+#define HAVE_STDIO_H 1
+#define STDC_HEADERS 1
+#define HAVE_STDLIB_H 1
+#define HAVE_STDARG_H 1
+#define HAVE_MALLOC_H 1
+#define HAVE_MEMORY_H 1
+#define HAVE_STRING_H 1
+#define HAVE_STRINGS_H 1
+#define HAVE_INTTYPES_H 1
+#define HAVE_STDINT_H 1
+#define HAVE_CTYPE_H 1
+#define HAVE_MATH_H 1
+#define HAVE_ICONV_H 1
+#define HAVE_SIGNAL_H 1
+/* #undef HAVE_ALTIVEC_H */
+
+/* C library functions */
+#define HAVE_MALLOC 1
+#define HAVE_CALLOC 1
+#define HAVE_REALLOC 1
+#define HAVE_FREE 1
+#define HAVE_ALLOCA 1
+#ifndef _WIN32 /* Don't use C runtime versions of these on Windows */
+#define HAVE_GETENV 1
+#define HAVE_PUTENV 1
+/* #undef HAVE_UNSETENV */
+#endif
+#define HAVE_QSORT 1
+#define HAVE_ABS 1
+#define HAVE_BCOPY 1
+#define HAVE_MEMSET 1
+#define HAVE_MEMCPY 1
+#define HAVE_MEMMOVE 1
+#define HAVE_MEMCMP 1
+#define HAVE_STRLEN 1
+#define HAVE_STRLCPY 1
+#define HAVE_STRLCAT 1
+#define HAVE_STRDUP 1
+/* #undef HAVE__STRREV */
+/* #undef HAVE__STRUPR */
+/* #undef HAVE__STRLWR */
+/* #undef HAVE_INDEX */
+/* #undef HAVE_RINDEX */
+#define HAVE_STRCHR 1
+#define HAVE_STRRCHR 1
+#define HAVE_STRSTR 1
+/* #undef HAVE_ITOA */
+#define HAVE__LTOA 1
+/* #undef HAVE__UITOA */
+#define HAVE__ULTOA 1
+#define HAVE_STRTOL 1
+#define HAVE_STRTOUL 1
+/* #undef HAVE__I64TOA */
+/* #undef HAVE__UI64TOA */
+#define HAVE_STRTOLL 1
+#define HAVE_STRTOULL 1
+#define HAVE_STRTOD 1
+#define HAVE_ATOI 1
+#define HAVE_ATOF 1
+#define HAVE_STRCMP 1
+#define HAVE_STRNCMP 1
+/* #undef HAVE__STRICMP */
+#define HAVE_STRCASECMP 1
+/* #undef HAVE__STRNICMP */
+#define HAVE_STRNCASECMP 1
+#define HAVE_SSCANF 1
+#define HAVE_SNPRINTF 1
+#define HAVE_VSNPRINTF 1
+#define HAVE_ICONV 1
+#define HAVE_SIGACTION 1
+#define HAVE_SA_SIGACTION 1
+#define HAVE_SETJMP 1
+#define HAVE_NANOSLEEP 1
+/* #undef HAVE_CLOCK_GETTIME */
+/* #undef HAVE_GETPAGESIZE */
+#define HAVE_MPROTECT 1
+/* #undef HAVE_SEM_TIMEDWAIT */
+
 #else
-#include "SDL_config_minimal.h"
-#endif /* platform config */
+/* We may need some replacement for stdarg.h here */
+#include <stdarg.h>
+#endif /* HAVE_LIBC */
+
+/* Allow disabling of core subsystems */
+/* #undef SDL_AUDIO_DISABLED */
+/* #undef SDL_CDROM_DISABLED */
+/* #undef SDL_CPUINFO_DISABLED */
+/* #undef SDL_EVENTS_DISABLED */
+/* #undef SDL_FILE_DISABLED */
+/* #undef SDL_JOYSTICK_DISABLED */
+/* #undef SDL_LOADSO_DISABLED */
+#define SDL_THREADS_DISABLED 1
+/* #undef SDL_TIMERS_DISABLED */
+/* #undef SDL_VIDEO_DISABLED */
+
+/* Enable various audio drivers */
+/* #undef SDL_AUDIO_DRIVER_ALSA */
+/* #undef SDL_AUDIO_DRIVER_ALSA_DYNAMIC */
+/* #undef SDL_AUDIO_DRIVER_ARTS */
+/* #undef SDL_AUDIO_DRIVER_ARTS_DYNAMIC */
+/* #undef SDL_AUDIO_DRIVER_BAUDIO */
+/* #undef SDL_AUDIO_DRIVER_BSD */
+/* #undef SDL_AUDIO_DRIVER_COREAUDIO */
+/* #undef SDL_AUDIO_DRIVER_DART */
+/* #undef SDL_AUDIO_DRIVER_DC */
+#define SDL_AUDIO_DRIVER_DISK 1
+#define SDL_AUDIO_DRIVER_DUMMY 1
+#define SDL_AUDIO_DRIVER_DMEDIA 1
+/* #undef SDL_AUDIO_DRIVER_DSOUND */
+/* #undef SDL_AUDIO_DRIVER_PULSE */
+/* #undef SDL_AUDIO_DRIVER_PULSE_DYNAMIC */
+/* #undef SDL_AUDIO_DRIVER_ESD */
+/* #undef SDL_AUDIO_DRIVER_ESD_DYNAMIC */
+/* #undef SDL_AUDIO_DRIVER_MINT */
+/* #undef SDL_AUDIO_DRIVER_MMEAUDIO */
+/* #undef SDL_AUDIO_DRIVER_NAS */
+/* #undef SDL_AUDIO_DRIVER_NAS_DYNAMIC */
+/* #undef SDL_AUDIO_DRIVER_OSS */
+/* #undef SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H */
+/* #undef SDL_AUDIO_DRIVER_PAUD */
+/* #undef SDL_AUDIO_DRIVER_QNXNTO */
+/* #undef SDL_AUDIO_DRIVER_SNDMGR */
+/* #undef SDL_AUDIO_DRIVER_SUNAUDIO */
+/* #undef SDL_AUDIO_DRIVER_WAVEOUT */
+
+/* Enable various cdrom drivers */
+/* #undef SDL_CDROM_AIX */
+/* #undef SDL_CDROM_BEOS */
+/* #undef SDL_CDROM_BSDI */
+/* #undef SDL_CDROM_DC */
+#define SDL_CDROM_DUMMY 1
+/* #undef SDL_CDROM_FREEBSD */
+/* #undef SDL_CDROM_LINUX */
+/* #undef SDL_CDROM_MACOS */
+/* #undef SDL_CDROM_MACOSX */
+/* #undef SDL_CDROM_MINT */
+/* #undef SDL_CDROM_OPENBSD */
+/* #undef SDL_CDROM_OS2 */
+/* #undef SDL_CDROM_OSF */
+/* #undef SDL_CDROM_QNX */
+/* #undef SDL_CDROM_WIN32 */
+
+/* Enable various input drivers */
+/* #undef SDL_INPUT_LINUXEV */
+/* #undef SDL_INPUT_TSLIB */
+/* #undef SDL_JOYSTICK_BEOS */
+/* #undef SDL_JOYSTICK_DC */
+#define SDL_JOYSTICK_DUMMY 1
+/* #undef SDL_JOYSTICK_IOKIT */
+/* #undef SDL_JOYSTICK_LINUX */
+/* #undef SDL_JOYSTICK_MACOS */
+/* #undef SDL_JOYSTICK_MINT */
+/* #undef SDL_JOYSTICK_OS2 */
+/* #undef SDL_JOYSTICK_RISCOS */
+/* #undef SDL_JOYSTICK_WINMM */
+/* #undef SDL_JOYSTICK_USBHID */
+/* #undef SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H */
+
+/* Enable various shared object loading systems */
+/* #undef SDL_LOADSO_BEOS */
+/* #undef SDL_LOADSO_DLCOMPAT */
+#define SDL_LOADSO_DLOPEN 1
+/* #undef SDL_LOADSO_DUMMY */
+/* #undef SDL_LOADSO_LDG */
+/* #undef SDL_LOADSO_MACOS */
+/* #undef SDL_LOADSO_OS2 */
+/* #undef SDL_LOADSO_WIN32 */
+
+/* Enable various threading systems */
+/* #undef SDL_THREAD_BEOS */
+/* #undef SDL_THREAD_DC */
+/* #undef SDL_THREAD_OS2 */
+/* #undef SDL_THREAD_PTH */
+/* #undef SDL_THREAD_PTHREAD */
+/* #undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX */
+/* #undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP */
+/* #undef SDL_THREAD_SPROC */
+/* #undef SDL_THREAD_WIN32 */
+
+/* Enable various timer systems */
+/* #undef SDL_TIMER_BEOS */
+/* #undef SDL_TIMER_DC */
+/* #undef SDL_TIMER_DUMMY */
+/* #undef SDL_TIMER_MACOS */
+/* #undef SDL_TIMER_MINT */
+/* #undef SDL_TIMER_OS2 */
+/* #undef SDL_TIMER_RISCOS */
+#define SDL_TIMER_UNIX 1
+/* #undef SDL_TIMER_WIN32 */
+/* #undef SDL_TIMER_WINCE */
+
+/* Enable various video drivers */
+/* #undef SDL_VIDEO_DRIVER_AALIB */
+/* #undef SDL_VIDEO_DRIVER_BWINDOW */
+/* #undef SDL_VIDEO_DRIVER_CACA */
+/* #undef SDL_VIDEO_DRIVER_DC */
+/* #undef SDL_VIDEO_DRIVER_DDRAW */
+#define SDL_VIDEO_DRIVER_DGA 1
+/* #undef SDL_VIDEO_DRIVER_DIRECTFB */
+/* #undef SDL_VIDEO_DRIVER_DRAWSPROCKET */
+#define SDL_VIDEO_DRIVER_DUMMY 1
+/* #undef SDL_VIDEO_DRIVER_FBCON */
+/* #undef SDL_VIDEO_DRIVER_GAPI */
+/* #undef SDL_VIDEO_DRIVER_GEM */
+/* #undef SDL_VIDEO_DRIVER_GGI */
+/* #undef SDL_VIDEO_DRIVER_IPOD */
+/* #undef SDL_VIDEO_DRIVER_NANOX */
+/* #undef SDL_VIDEO_DRIVER_OS2FS */
+/* #undef SDL_VIDEO_DRIVER_PHOTON */
+/* #undef SDL_VIDEO_DRIVER_PICOGUI */
+/* #undef SDL_VIDEO_DRIVER_PS2GS */
+/* #undef SDL_VIDEO_DRIVER_PS3 */
+/* #undef SDL_VIDEO_DRIVER_QTOPIA */
+/* #undef SDL_VIDEO_DRIVER_QUARTZ */
+/* #undef SDL_VIDEO_DRIVER_RISCOS */
+/* #undef SDL_VIDEO_DRIVER_SVGALIB */
+/* #undef SDL_VIDEO_DRIVER_TOOLBOX */
+/* #undef SDL_VIDEO_DRIVER_VGL */
+/* #undef SDL_VIDEO_DRIVER_WINDIB */
+/* #undef SDL_VIDEO_DRIVER_WSCONS */
+#define SDL_VIDEO_DRIVER_X11 1
+#define SDL_VIDEO_DRIVER_X11_DGAMOUSE 1
+/* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC */
+/* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT */
+/* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR */
+/* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER */
+#define SDL_VIDEO_DRIVER_X11_VIDMODE 1
+#define SDL_VIDEO_DRIVER_X11_XINERAMA 1
+#define SDL_VIDEO_DRIVER_X11_XME 1
+/* #undef SDL_VIDEO_DRIVER_X11_XRANDR */
+#define SDL_VIDEO_DRIVER_X11_XV 1
+/* #undef SDL_VIDEO_DRIVER_XBIOS */
+
+/* Enable OpenGL support */
+#define SDL_VIDEO_OPENGL 1
+#define SDL_VIDEO_OPENGL_GLX 1
+/* #undef SDL_VIDEO_OPENGL_WGL */
+/* #undef SDL_VIDEO_OPENGL_OSMESA */
+/* #undef SDL_VIDEO_OPENGL_OSMESA_DYNAMIC */
+
+/* Disable screensaver */
+#define SDL_VIDEO_DISABLE_SCREENSAVER 1
+
+/* Enable assembly routines */
+#define SDL_ASSEMBLY_ROUTINES 1
+/* #undef SDL_HERMES_BLITTERS */
+/* #undef SDL_ALTIVEC_BLITTERS */
 
 #endif /* _SDL_config_h */
--- SDL-1.2.15/include/SDL_video.h	Thu Jan 19 07:30:06 2012
+++ SDL-1.2.15/include/SDL_video.h	Fri May  3 17:41:11 2019
@@ -824,6 +824,11 @@
 
 /*@}*/
 
+                    
+extern DECLSPEC void SDLCALL SDL_GL_DisableContext(void);	/* DAJ ENABLE_INTEL_SMP */
+extern DECLSPEC void SDLCALL SDL_GL_EnableContext_Thread(void);	/* DAJ ENABLE_INTEL_SMP */
+
+
 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 /** @name OpenGL support functions.                                          */ /*@{*/
 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
--- SDL-1.2.15/include/begin_code.h	Thu Jan 19 07:30:06 2012
+++ SDL-1.2.15/include/begin_code.h	Fri May  3 18:03:39 2019
@@ -155,7 +155,7 @@
 #if defined(_MSC_VER) || defined(__BORLANDC__) || \
     defined(__DMC__) || defined(__SC__) || \
     defined(__WATCOMC__) || defined(__LCC__) || \
-    defined(__DECC) || defined(__EABI__)
+    defined(__DECC) || defined(__EABI__) || defined(__sgi)
 #ifndef __inline__
 #define __inline__	__inline
 #endif
--- SDL-1.2.15/src/SDL.c	Thu Jan 19 07:30:06 2012
+++ SDL-1.2.15/src/SDL.c	Fri May  3 17:41:11 2019
@@ -248,6 +248,7 @@
 
 }
 
+
 /* Return the library version number */
 const SDL_version * SDL_Linked_Version(void)
 {
--- SDL-1.2.15/src/events/SDL_keyboard.c	Thu Jan 19 07:30:06 2012
+++ SDL-1.2.15/src/events/SDL_keyboard.c	Fri May  3 17:41:11 2019
@@ -419,6 +419,10 @@
 			case SDLK_UNKNOWN:
 				break;
 			case SDLK_NUMLOCK:
+#ifdef MACOSX /* michael, we want numlock/clear to behave like a normal key */
+				modstate |= KMOD_NUM;
+				break;
+#else
 				modstate ^= KMOD_NUM;
 				if ( SDL_NoLockKeys & SDL_NLK_NUM )
 					break;
@@ -426,7 +430,12 @@
 					state = SDL_RELEASED;
 				keysym->mod = (SDLMod)modstate;
 				break;
+#endif
 			case SDLK_CAPSLOCK:
+#ifdef MACOSX /* michael, we want capslock to behave like a normal key */
+				modstate |= KMOD_CAPS;
+				break;
+#else
 				modstate ^= KMOD_CAPS;
 				if ( SDL_NoLockKeys & SDL_NLK_CAPS )
 					break;
@@ -434,6 +443,7 @@
 					state = SDL_RELEASED;
 				keysym->mod = (SDLMod)modstate;
 				break;
+#endif
 			case SDLK_LCTRL:
 				modstate |= KMOD_LCTRL;
 				break;
--- SDL-1.2.15/src/joystick/linux/SDL_sysjoystick.c	Thu Jan 19 07:30:06 2012
+++ SDL-1.2.15/src/joystick/linux/SDL_sysjoystick.c	Fri May  3 17:40:03 2019
@@ -1106,6 +1106,9 @@
 				}
 				break;
 			    case EV_ABS:
+				if (code > ABS_MISC) {
+					break;
+				}
 				switch (code) {
 				    case ABS_HAT0X:
 				    case ABS_HAT0Y:
--- SDL-1.2.15/src/video/SDL_gamma.c	Thu Jan 19 07:30:06 2012
+++ SDL-1.2.15/src/video/SDL_gamma.c	Fri May  3 17:40:28 2019
@@ -92,22 +92,11 @@
 
 int SDL_SetGamma(float red, float green, float blue)
 {
-	int succeeded;
+	int succeeded = -1;
 	SDL_VideoDevice *video = current_video;
 	SDL_VideoDevice *this  = current_video;	
 
-	succeeded = -1;
-	/* Prefer using SetGammaRamp(), as it's more flexible */
-	{
-		Uint16 ramp[3][256];
-
-		CalculateGammaRamp(red, ramp[0]);
-		CalculateGammaRamp(green, ramp[1]);
-		CalculateGammaRamp(blue, ramp[2]);
-		succeeded = SDL_SetGammaRamp(ramp[0], ramp[1], ramp[2]);
-	}
-	if ( (succeeded < 0) && video->SetGamma ) {
-		SDL_ClearError();
+	if ( video->SetGamma ) {
 		succeeded = video->SetGamma(this, red, green, blue);
 	}
 	return succeeded;
--- SDL-1.2.15/src/video/SDL_sysvideo.h	Thu Jan 19 07:30:06 2012
+++ SDL-1.2.15/src/video/SDL_sysvideo.h	Fri May  3 17:41:11 2019
@@ -179,6 +179,12 @@
 	/* Make the context associated with this driver current */
 	int (*GL_MakeCurrent)(_THIS);
 
+	/* Make the context current to the calling thread */
+	int (*GL_MakeCurrent_Thread)(_THIS);
+
+	/* Swap the current context. */
+	int (*GL_DisableContext)(_THIS);
+
 	/* Swap the current buffers in double buffer mode. */
 	void (*GL_SwapBuffers)(_THIS);
 
--- SDL-1.2.15/src/video/SDL_video.c	Thu Jan 19 07:30:06 2012
+++ SDL-1.2.15/src/video/SDL_video.c	Fri May  3 17:41:11 2019
@@ -1692,6 +1692,22 @@
 
 void SDL_Audio_SetCaption(const char *caption);
 
+void SDL_GL_DisableContext()	/*DAJ ENABLE_INTEL_SMP*/
+{
+	SDL_VideoDevice *this = current_video;
+	
+	this->GL_DisableContext( this );
+}
+
+void SDL_GL_EnableContext_Thread() {
+	SDL_VideoDevice *this = current_video;
+#ifdef MACOSX
+	this->GL_MakeCurrent( this );
+#else
+	this->GL_MakeCurrent_Thread( this );
+#endif
+}
+
 /*
  * Sets/Gets the title and icon text of the display window, if any.
  */
--- SDL-1.2.15/src/video/SDL_yuv_sw.c	Thu Jan 19 07:30:06 2012
+++ SDL-1.2.15/src/video/SDL_yuv_sw.c	Fri May  3 17:40:51 2019
@@ -89,6 +89,8 @@
 #include "SDL_yuvfuncs.h"
 #include "SDL_yuv_sw_c.h"
 
+#undef __OPTIMIZE__
+
 /* The functions used to manipulate software video overlays */
 static struct private_yuvhwfuncs sw_yuvfuncs = {
 	SDL_LockYUV_SW,
--- SDL-1.2.15/src/video/maccommon/SDL_macgl.c	Thu Jan 19 07:30:06 2012
+++ SDL-1.2.15/src/video/maccommon/SDL_macgl.c	Fri May  3 17:41:11 2019
@@ -101,6 +101,7 @@
 	}
 
 	attributes[i++] = AGL_ALL_RENDERERS;
+	attributes[i++] = AGL_MP_SAFE; /*DAJ ENABLE_INTEL_SMP*/
 	attributes[i]	= AGL_NONE;
 
 	format = aglChoosePixelFormat(NULL, 0, attributes);
@@ -114,6 +115,7 @@
 		SDL_SetError("Couldn't create OpenGL context");
 		return(-1);
 	}
+	
 	aglDestroyPixelFormat(format);
 
     #if  TARGET_API_MAC_CARBON
--- SDL-1.2.15/src/video/quartz/SDL_QuartzGL.m	Thu Jan 19 07:30:06 2012
+++ SDL-1.2.15/src/video/quartz/SDL_QuartzGL.m	Fri May  3 17:41:11 2019
@@ -129,6 +129,7 @@
 
     attr[i++] = NSOpenGLPFAScreenMask;
     attr[i++] = CGDisplayIDToOpenGLDisplayMask (display_id);
+    attr[i++] = NSOpenGLPFAMPSafe;		/*DAJ ENABLE_INTEL_SMP*/
     attr[i] = 0;
 
     fmt = [ [ NSOpenGLPixelFormat alloc ] initWithAttributes:attr ];
@@ -284,6 +285,11 @@
 
 int    QZ_GL_MakeCurrent    (_THIS) {
     [ gl_context makeCurrentContext ];
+    return 0;
+}
+
+int    QZ_GL_DisableContext   (_THIS) {	/*DAJ ENABLE_INTEL_SMP*/
+	[ NULL makeCurrentContext ];
     return 0;
 }
 
--- SDL-1.2.15/src/video/quartz/SDL_QuartzVideo.h	Thu Jan 19 07:30:06 2012
+++ SDL-1.2.15/src/video/quartz/SDL_QuartzVideo.h	Fri May  3 17:41:11 2019
@@ -194,6 +194,7 @@
 void*  QZ_GL_GetProcAddress (_THIS, const char *proc);
 int    QZ_GL_GetAttribute   (_THIS, SDL_GLattr attrib, int* value);
 int    QZ_GL_MakeCurrent    (_THIS);
+int    QZ_GL_DisableContext (_THIS);	/*DAJ ENABLE_INTEL_SMP*/
 void   QZ_GL_SwapBuffers    (_THIS);
 int    QZ_GL_LoadLibrary    (_THIS, const char *location);
 
--- SDL-1.2.15/src/video/quartz/SDL_QuartzVideo.m	Thu Jan 19 07:30:06 2012
+++ SDL-1.2.15/src/video/quartz/SDL_QuartzVideo.m	Fri May  3 17:41:11 2019
@@ -205,6 +205,7 @@
     device->GL_GetProcAddress = QZ_GL_GetProcAddress;
     device->GL_GetAttribute   = QZ_GL_GetAttribute;
     device->GL_MakeCurrent    = QZ_GL_MakeCurrent;
+	device->GL_DisableContext = QZ_GL_DisableContext;
     device->GL_SwapBuffers    = QZ_GL_SwapBuffers;
     device->GL_LoadLibrary    = QZ_GL_LoadLibrary;
 
--- SDL-1.2.15/src/video/x11/SDL_x11events.c	Thu Jan 19 07:30:06 2012
+++ SDL-1.2.15/src/video/x11/SDL_x11events.c	Fri May  3 17:41:00 2019
@@ -57,12 +57,6 @@
 static SDLKey MISC_keymap[256];
 SDLKey X11_TranslateKeycode(Display *display, KeyCode kc);
 
-/*
- Pending resize target for ConfigureNotify (so outdated events don't
- cause inappropriate resize events)
-*/
-int X11_PendingConfigureNotifyWidth = -1;
-int X11_PendingConfigureNotifyHeight = -1;
 
 #ifdef X_HAVE_UTF8_STRING
 Uint32 Utf8ToUcs4(const Uint8 *utf8)
@@ -395,6 +389,8 @@
 {
 	int posted;
 	XEvent xevent;
+	int orig_event_type;
+	KeyCode orig_keycode;
 
 	SDL_memset(&xevent, '\0', sizeof (XEvent));  /* valgrind fix. --ryan. */
 	XNextEvent(SDL_Display, &xevent);
@@ -410,9 +406,29 @@
 #ifdef X_HAVE_UTF8_STRING
 	/* If we are translating with IM, we need to pass all events
 	   to XFilterEvent, and discard those filtered events immediately.  */
+	orig_event_type = xevent.type;
+	if (orig_event_type == KeyPress || orig_event_type == KeyRelease) {
+	     orig_keycode = xevent.xkey.keycode;
+	} else {
+	     orig_keycode = 0;
+	}
 	if ( SDL_TranslateUNICODE
 	     && SDL_IM != NULL
 	     && XFilterEvent(&xevent, None) ) {
+	        if (orig_keycode) {
+	            SDL_keysym keysym;
+	            static XComposeStatus state;
+	            char keybuf[32];
+
+	            keysym.scancode = xevent.xkey.keycode;
+	            keysym.sym = X11_TranslateKeycode(SDL_Display, xevent.xkey.keycode);
+	            keysym.mod = KMOD_NONE;
+	            keysym.unicode = 0;
+	            if (orig_event_type == KeyPress && XLookupString(&xevent.xkey, keybuf, sizeof(keybuf), NULL, &state))
+	                keysym.unicode = (Uint8)keybuf[0];
+
+	            SDL_PrivateKeyboard(orig_event_type == KeyPress ? SDL_PRESSED : SDL_RELEASED, &keysym);
+	        }
 		return 0;
 	}
 #endif
@@ -429,12 +445,15 @@
 if ( xevent.xcrossing.mode == NotifyUngrab )
 printf("Mode: NotifyUngrab\n");
 #endif
-		if ( this->input_grab == SDL_GRAB_OFF ) {
-			posted = SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS);
+		if ( (xevent.xcrossing.mode != NotifyGrab) &&
+		     (xevent.xcrossing.mode != NotifyUngrab) ) {
+			if ( this->input_grab == SDL_GRAB_OFF ) {
+				posted = SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS);
+			}
+			posted = SDL_PrivateMouseMotion(0, 0,
+					xevent.xcrossing.x,
+					xevent.xcrossing.y);
 		}
-		posted = SDL_PrivateMouseMotion(0, 0,
-				xevent.xcrossing.x,
-				xevent.xcrossing.y);
 	    }
 	    break;
 
@@ -825,16 +844,6 @@
 #ifdef DEBUG_XEVENTS
 printf("ConfigureNotify! (resize: %dx%d)\n", xevent.xconfigure.width, xevent.xconfigure.height);
 #endif
-		if ((X11_PendingConfigureNotifyWidth != -1) &&
-		    (X11_PendingConfigureNotifyHeight != -1)) {
-		    if ((xevent.xconfigure.width != X11_PendingConfigureNotifyWidth) &&
-			(xevent.xconfigure.height != X11_PendingConfigureNotifyHeight)) {
-			    /* Event is from before the resize, so ignore. */
-			    break;
-		    }
-		    X11_PendingConfigureNotifyWidth = -1;
-		    X11_PendingConfigureNotifyHeight = -1;
-		}
 		if ( SDL_VideoSurface ) {
 		    if ((xevent.xconfigure.width != SDL_VideoSurface->w) ||
 		        (xevent.xconfigure.height != SDL_VideoSurface->h)) {
@@ -1246,8 +1255,11 @@
  * sequences (dead accents, compose key sequences) will not work since the
  * state has been irrevocably lost.
  */
+extern DECLSPEC Uint16 SDLCALL X11_KeyToUnicode(SDLKey, SDLMod);
+
 Uint16 X11_KeyToUnicode(SDLKey keysym, SDLMod modifiers)
 {
+	static int warning = 0;
 	struct SDL_VideoDevice *this = current_video;
 	char keybuf[32];
 	int i;
@@ -1254,6 +1266,12 @@
 	KeySym xsym = 0;
 	XKeyEvent xkey;
 	Uint16 unicode;
+
+	if ( warning ) {
+		warning = 0;
+		fprintf(stderr, "WARNING: Application is using X11_KeyToUnicode().\n");
+		fprintf(stderr, "This is not an official SDL function, please report this as a bug.\n");
+	}
 
 	if ( !this || !SDL_Display ) {
 		return 0;
--- SDL-1.2.15/src/video/x11/SDL_x11events_c.h	Thu Jan 19 07:30:06 2012
+++ SDL-1.2.15/src/video/x11/SDL_x11events_c.h	Fri May  3 17:40:42 2019
@@ -27,8 +27,3 @@
 extern void X11_InitOSKeymap(_THIS);
 extern void X11_PumpEvents(_THIS);
 extern void X11_SetKeyboardState(Display *display, const char *key_vec);
-
-/* Variables to be exported */
-extern int X11_PendingConfigureNotifyWidth;
-extern int X11_PendingConfigureNotifyHeight;
-
--- SDL-1.2.15/src/video/x11/SDL_x11gl.c	Thu Jan 19 07:30:06 2012
+++ SDL-1.2.15/src/video/x11/SDL_x11gl.c	Fri May  3 17:41:11 2019
@@ -352,6 +352,33 @@
 	return(retval);
 }
 
+/* id: Make the current context active to the calling thread. */
+int X11_GL_MakeCurrent_Thread(_THIS)
+{
+	int retval;
+	
+	retval = 0;
+	if ( ! this->gl_data->glXMakeCurrent(GFX_Display,
+	                                     SDL_Window, glx_context) ) {
+		SDL_SetError("Unable to make GL context current");
+		retval = -1;
+	}
+	return retval;
+}
+
+/* Disable the context */
+int X11_GL_DisableContext(_THIS)
+{
+	int retval;
+
+	retval = 0;
+	if ( !this->gl_data->glXMakeCurrent( GFX_Display, None, NULL ) ) {
+		SDL_SetError( "Unable to disable GL context" );
+		retval = -1;
+	}
+	return(retval);
+}
+
 /* Get attribute data from glX. */
 int X11_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value)
 {
--- SDL-1.2.15/src/video/x11/SDL_x11gl_c.h	Thu Jan 19 07:30:06 2012
+++ SDL-1.2.15/src/video/x11/SDL_x11gl_c.h	Fri May  3 17:41:11 2019
@@ -90,6 +90,8 @@
 extern void X11_GL_Shutdown(_THIS);
 #if SDL_VIDEO_OPENGL_GLX
 extern int X11_GL_MakeCurrent(_THIS);
+extern int X11_GL_MakeCurrent_Thread(_THIS);
+extern int X11_GL_DisableContext(_THIS);
 extern int X11_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value);
 extern void X11_GL_SwapBuffers(_THIS);
 extern int X11_GL_LoadLibrary(_THIS, const char* path);
--- SDL-1.2.15/src/video/x11/SDL_x11sym.h	Thu Jan 19 07:30:06 2012
+++ SDL-1.2.15/src/video/x11/SDL_x11sym.h	Fri May  3 17:39:55 2019
@@ -165,7 +165,7 @@
  */
 #ifdef LONG64
 SDL_X11_MODULE(IO_32BIT)
-SDL_X11_SYM(int,_XData32,(Display *dpy,register long *data,unsigned len),(dpy,data,len),return)
+SDL_X11_SYM(int,_XData32,(Display *dpy,register _Xconst long *data,unsigned len),(dpy,data,len),return)
 SDL_X11_SYM(void,_XRead32,(Display *dpy,register long *data,long len),(dpy,data,len),)
 #endif
 
--- SDL-1.2.15/src/video/x11/SDL_x11video.c	Thu Jan 19 07:30:06 2012
+++ SDL-1.2.15/src/video/x11/SDL_x11video.c	Fri May  3 17:41:11 2019
@@ -158,6 +158,8 @@
 		device->GL_GetProcAddress = X11_GL_GetProcAddress;
 		device->GL_GetAttribute = X11_GL_GetAttribute;
 		device->GL_MakeCurrent = X11_GL_MakeCurrent;
+		device->GL_DisableContext = X11_GL_DisableContext;
+		device->GL_MakeCurrent_Thread = X11_GL_MakeCurrent_Thread;
 		device->GL_SwapBuffers = X11_GL_SwapBuffers;
 #endif
 		device->SetCaption = X11_SetCaption;
@@ -1088,7 +1090,7 @@
 		}
 	}
 
-#if 0 /* This is an experiment - are the graphics faster now? - nope. */
+#if 1 /* This is an experiment - are the graphics faster now? - nope. */
 	if ( SDL_getenv("SDL_VIDEO_X11_BACKINGSTORE") )
 #endif
 	/* Cache the window in the server, when possible */
@@ -1177,8 +1179,6 @@
 			current = NULL;
 			goto done;
 		}
-		X11_PendingConfigureNotifyWidth = width;
-		X11_PendingConfigureNotifyHeight = height;
 	} else {
 		if (X11_CreateWindow(this,current,width,height,bpp,flags) < 0) {
 			current = NULL;
--- SDL-1.2.15/src/video/x11/SDL_x11wm.c	Thu Jan 19 07:30:06 2012
+++ SDL-1.2.15/src/video/x11/SDL_x11wm.c	Fri May  3 17:39:09 2019
@@ -352,7 +352,7 @@
 			result = XGrabPointer(SDL_Display, SDL_Window, True, 0,
 						GrabModeAsync, GrabModeAsync,
 						SDL_Window, None, CurrentTime);
-			if ( result == GrabSuccess ) {
+			if ( result == GrabSuccess || result == GrabNotViewable ) {
 				break;
 			}
 			SDL_Delay(100);
@@ -359,6 +359,7 @@
 		}
 		if ( result != GrabSuccess ) {
 			/* Uh, oh, what do we do here? */ ;
+			return(SDL_GRAB_OFF);
 		}
 		/* Now grab the keyboard */
 		XGrabKeyboard(SDL_Display, WMwindow, True,
