From 0953767382e9a44473caf0eaed3eed1893626c7a Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 18 Jul 2010 11:24:37 -0700 Subject: [PATCH] RedHat patch: SDL-1.2.14-xio_error-rh603984.patch --- src/video/x11/SDL_x11mouse.c | 4 ++++ src/video/x11/SDL_x11wm.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/video/x11/SDL_x11mouse.c b/src/video/x11/SDL_x11mouse.c index 29d5e676e..ae716c88a 100644 --- a/src/video/x11/SDL_x11mouse.c +++ b/src/video/x11/SDL_x11mouse.c @@ -230,6 +230,10 @@ void X11_CheckMouseModeNoLock(_THIS) char *env_override; int enable_relative = 1; + /* This happens when quiting after an xio error */ + if ( SDL_Display == NULL ) + return; + /* Allow the user to override the relative mouse mode. They almost never want to do this, as it seriously affects applications that rely on continuous relative mouse motion. diff --git a/src/video/x11/SDL_x11wm.c b/src/video/x11/SDL_x11wm.c index 99bd0ab8d..9d687d419 100644 --- a/src/video/x11/SDL_x11wm.c +++ b/src/video/x11/SDL_x11wm.c @@ -329,7 +329,7 @@ SDL_GrabMode X11_GrabInputNoLock(_THIS, SDL_GrabMode mode) { int result; - if ( this->screen == NULL ) { + if ( this->screen == NULL || SDL_Display == NULL ) { return(SDL_GRAB_OFF); } if ( ! SDL_Window ) {