diff --git a/src/video/raspberry/SDL_rpimouse.c b/src/video/raspberry/SDL_rpimouse.c index f6c128f58..b4711e41b 100644 --- a/src/video/raspberry/SDL_rpimouse.c +++ b/src/video/raspberry/SDL_rpimouse.c @@ -132,19 +132,21 @@ RPI_ShowCursor(SDL_Cursor * cursor) return 0; } - if (global_cursor != NULL) { - curdata = (RPI_CursorData *) global_cursor->driverdata; - if (curdata && curdata->element > DISPMANX_NO_HANDLE) { - update = vc_dispmanx_update_start(0); - SDL_assert(update); - ret = vc_dispmanx_element_remove(update, curdata->element); - SDL_assert(ret == DISPMANX_SUCCESS); - ret = vc_dispmanx_update_submit_sync(update); - SDL_assert(ret == DISPMANX_SUCCESS); - curdata->element = DISPMANX_NO_HANDLE; + if (cursor != global_cursor) { + if (global_cursor != NULL) { + curdata = (RPI_CursorData *) global_cursor->driverdata; + if (curdata && curdata->element > DISPMANX_NO_HANDLE) { + update = vc_dispmanx_update_start(0); + SDL_assert(update); + ret = vc_dispmanx_element_remove(update, curdata->element); + SDL_assert(ret == DISPMANX_SUCCESS); + ret = vc_dispmanx_update_submit_sync(update); + SDL_assert(ret == DISPMANX_SUCCESS); + curdata->element = DISPMANX_NO_HANDLE; + } } + global_cursor = cursor; } - global_cursor = cursor; if (cursor == NULL) { return 0;