From d2058b45ae7744c665266409ac12a4e951b39737 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Tue, 2 Jul 2019 10:26:54 -0400 Subject: [PATCH] raspberry: Fixed missing mouse cursor (thanks, Joe!) "Starting with changeset 12433, the mouse cursor is not displayed on the Raspberry Pi platform, due to a bug in the handling of the new "global_cursor" in RPI_ShowCursor(). Currently, if cursor == global_cursor, the function immediately returns 0. The function should not return here. Instead, if cursor == global_cursor, it shouldn't try to hide the current cursor and update global_cursor = cursor. However, it *should* still continue through the rest of the function." Fixes Bugzilla #4699. --- src/video/raspberry/SDL_rpimouse.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/video/raspberry/SDL_rpimouse.c b/src/video/raspberry/SDL_rpimouse.c index f6c128f585a48..b4711e41bc163 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;