From 0b9a5b1ecbcf41f94b072e426e5df61bc2a6f828 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 30 Jan 2006 13:30:44 +0000 Subject: [PATCH] Fixed crash: #include int main(int argc, char** argv) { SDL_Init(SDL_INIT_EVERYTHING); SDL_SetVideoMode(640, 480, 0, SDL_FULLSCREEN); SDL_ShowCursor(SDL_DISABLE); SDL_Delay(1000); SDL_SetVideoMode(640, 480, 0, SDL_FULLSCREEN | SDL_OPENGL); SDL_Quit(); printf("Everything okay\n"); } --- src/video/SDL_cursor.c | 4 ++-- src/video/SDL_video.c | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/video/SDL_cursor.c b/src/video/SDL_cursor.c index 115fae111..7331fe085 100644 --- a/src/video/SDL_cursor.c +++ b/src/video/SDL_cursor.c @@ -208,9 +208,9 @@ void SDL_SetCursor (SDL_Cursor *cursor) if ( SDL_cursor && (SDL_cursorstate&CURSOR_VISIBLE) ) { /* Use window manager cursor if possible */ if ( SDL_cursor->wm_cursor && - video->ShowWMCursor(this, SDL_cursor->wm_cursor) ) + video->ShowWMCursor(this, SDL_cursor->wm_cursor) ) { SDL_cursorstate &= ~CURSOR_USINGSW; - else { + } else { SDL_cursorstate |= CURSOR_USINGSW; if ( video->ShowWMCursor ) { video->ShowWMCursor(this, NULL); diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index dbf2ed7bf..701067a2a 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -643,6 +643,7 @@ SDL_Surface * SDL_SetVideoMode (int width, int height, int bpp, Uint32 flags) /* Reset the keyboard here so event callbacks can run */ SDL_ResetKeyboard(); SDL_ResetMouse(); + SDL_cursorstate &= ~CURSOR_USINGSW; /* Clean up any previous video mode */ if ( SDL_PublicSurface != NULL ) {