otaylor / rpms / SDL

Forked from rpms/SDL 5 years ago
Clone
508c6ed
diff -up SDL-1.2.14/src/video/x11/SDL_x11mouse.c~ SDL-1.2.14/src/video/x11/SDL_x11mouse.c
508c6ed
--- SDL-1.2.14/src/video/x11/SDL_x11mouse.c~	2009-10-13 01:07:15.000000000 +0200
508c6ed
+++ SDL-1.2.14/src/video/x11/SDL_x11mouse.c	2010-06-23 14:16:34.730381512 +0200
508c6ed
@@ -230,6 +230,10 @@ void X11_CheckMouseModeNoLock(_THIS)
508c6ed
 	char *env_override;
508c6ed
 	int enable_relative = 1;
508c6ed
 
508c6ed
+	/* This happens when quiting after an xio error */
508c6ed
+	if ( SDL_Display == NULL )
508c6ed
+	        return;
508c6ed
+
508c6ed
 	/* Allow the user to override the relative mouse mode.
508c6ed
 	   They almost never want to do this, as it seriously affects
508c6ed
 	   applications that rely on continuous relative mouse motion.
508c6ed
diff -up SDL-1.2.14/src/video/x11/SDL_x11wm.c~ SDL-1.2.14/src/video/x11/SDL_x11wm.c
508c6ed
--- SDL-1.2.14/src/video/x11/SDL_x11wm.c~	2009-10-13 01:07:15.000000000 +0200
508c6ed
+++ SDL-1.2.14/src/video/x11/SDL_x11wm.c	2010-06-23 14:11:55.596629337 +0200
508c6ed
@@ -329,7 +329,7 @@ SDL_GrabMode X11_GrabInputNoLock(_THIS, 
508c6ed
 {
508c6ed
 	int result;
508c6ed
 
508c6ed
-	if ( this->screen == NULL ) {
508c6ed
+	if ( this->screen == NULL || SDL_Display == NULL ) {
508c6ed
 		return(SDL_GRAB_OFF);
508c6ed
 	}
508c6ed
 	if ( ! SDL_Window ) {