src/video/SDL_cursor.c
branchSDL-1.2
changeset 3897 37dab4a917c4
parent 1428 5f52867ba65c
child 4159 a1b03ba2fcd0
     1.1 --- a/src/video/SDL_cursor.c	Mon Nov 13 03:58:22 2006 +0000
     1.2 +++ b/src/video/SDL_cursor.c	Sun Nov 19 14:07:32 2006 +0000
     1.3 @@ -188,7 +188,7 @@
     1.4  			   it needs to hide the old cursor before (possibly)
     1.5  			   showing the new one.  (But don't erase NULL cursor)
     1.6  			 */
     1.7 -			if ( SDL_cursor ) {
     1.8 +			if ( SDL_cursor && video->ShowWMCursor ) {
     1.9  				video->ShowWMCursor(this, NULL);
    1.10  			}
    1.11  		}
    1.12 @@ -198,8 +198,11 @@
    1.13  	/* Draw the new mouse cursor */
    1.14  	if ( SDL_cursor && (SDL_cursorstate&CURSOR_VISIBLE) ) {
    1.15  		/* Use window manager cursor if possible */
    1.16 -		if ( SDL_cursor->wm_cursor && 
    1.17 -	             video->ShowWMCursor(this, SDL_cursor->wm_cursor) ) {
    1.18 +		int show_wm_cursor = 0;
    1.19 +		if ( SDL_cursor->wm_cursor && video->ShowWMCursor ) {
    1.20 +			show_wm_cursor = video->ShowWMCursor(this, SDL_cursor->wm_cursor);
    1.21 +		}
    1.22 +		if ( show_wm_cursor ) {
    1.23  			SDL_cursorstate &= ~CURSOR_USINGSW;
    1.24  		} else {
    1.25  			SDL_cursorstate |= CURSOR_USINGSW;
    1.26 @@ -219,7 +222,9 @@
    1.27  			SDL_EraseCursor(SDL_VideoSurface);
    1.28  		} else {
    1.29  			if ( video ) {
    1.30 -				video->ShowWMCursor(this, NULL);
    1.31 +				if ( video->ShowWMCursor ) {
    1.32 +					video->ShowWMCursor(this, NULL);
    1.33 +				}
    1.34  			}
    1.35  		}
    1.36  	}
    1.37 @@ -248,7 +253,9 @@
    1.38  				SDL_free(cursor->save[0]);
    1.39  			}
    1.40  			if ( video && cursor->wm_cursor ) {
    1.41 -				video->FreeWMCursor(this, cursor->wm_cursor);
    1.42 +				if ( video->FreeWMCursor ) {
    1.43 +					video->FreeWMCursor(this, cursor->wm_cursor);
    1.44 +				}
    1.45  			}
    1.46  			SDL_free(cursor);
    1.47  		}