src/video/raspberry/SDL_rpimouse.c
changeset 12922 db02dca46a9e
parent 12503 806492103856
child 12924 9cbdc68e4a5e
     1.1 --- a/src/video/raspberry/SDL_rpimouse.c	Tue Jul 02 09:43:26 2019 -0400
     1.2 +++ b/src/video/raspberry/SDL_rpimouse.c	Tue Jul 02 10:26:54 2019 -0400
     1.3 @@ -132,19 +132,21 @@
     1.4          return 0;
     1.5      }
     1.6  
     1.7 -    if (global_cursor != NULL) {
     1.8 -        curdata = (RPI_CursorData *) global_cursor->driverdata;
     1.9 -        if (curdata && curdata->element > DISPMANX_NO_HANDLE) {
    1.10 -            update = vc_dispmanx_update_start(0);
    1.11 -            SDL_assert(update);
    1.12 -            ret = vc_dispmanx_element_remove(update, curdata->element);
    1.13 -            SDL_assert(ret == DISPMANX_SUCCESS);
    1.14 -            ret = vc_dispmanx_update_submit_sync(update);
    1.15 -            SDL_assert(ret == DISPMANX_SUCCESS);
    1.16 -            curdata->element = DISPMANX_NO_HANDLE;
    1.17 +    if (cursor != global_cursor) {
    1.18 +        if (global_cursor != NULL) {
    1.19 +            curdata = (RPI_CursorData *) global_cursor->driverdata;
    1.20 +            if (curdata && curdata->element > DISPMANX_NO_HANDLE) {
    1.21 +                update = vc_dispmanx_update_start(0);
    1.22 +                SDL_assert(update);
    1.23 +                ret = vc_dispmanx_element_remove(update, curdata->element);
    1.24 +                SDL_assert(ret == DISPMANX_SUCCESS);
    1.25 +                ret = vc_dispmanx_update_submit_sync(update);
    1.26 +                SDL_assert(ret == DISPMANX_SUCCESS);
    1.27 +                curdata->element = DISPMANX_NO_HANDLE;
    1.28 +            }
    1.29          }
    1.30 +        global_cursor = cursor;
    1.31      }
    1.32 -    global_cursor = cursor;
    1.33  
    1.34      if (cursor == NULL) {
    1.35          return 0;