| Summary: | Mouse Pointer Raspberry Pi corrupt when moving over screen edges | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Patrick Gutlich <patrick> |
| Component: | video | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | blocker | ||
| Priority: | P2 | ||
| Version: | HG 2.0 | ||
| Hardware: | ARM | ||
| OS: | Linux | ||
Fixed, thanks! https://hg.libsdl.org/SDL/rev/2b008531d078 |
The mouse cursor gets corrupted when the mouse moves over the screen edges (right and bottom) a weird type of scaling seems to occur and you end up with a blank square. Suggested Fix for sdl_rpimouse.c: /* Warp the mouse to (x,y) */ static int RPI_WarpMouseGlobal(int x, int y) { RPI_CursorData *curdata; DISPMANX_UPDATE_HANDLE_T update; int ret; VC_RECT_T dst_rect; VC_RECT_T src_rect; SDL_Mouse *mouse = SDL_GetMouse(); if (mouse != NULL && mouse->cur_cursor != NULL && mouse->cur_cursor->driverdata != NULL) { curdata = (RPI_CursorData *) mouse->cur_cursor->driverdata; if (curdata->element != DISPMANX_NO_HANDLE) { update = vc_dispmanx_update_start( 10 ); SDL_assert( update ); src_rect.x = 0; src_rect.y = 0; src_rect.width = curdata->w << 16; src_rect.height = curdata->h << 16; dst_rect.x = x; dst_rect.y = y; dst_rect.width = curdata->w; dst_rect.height = curdata->h; ret = vc_dispmanx_element_change_attributes( update, curdata->element, 0, 0, 0, &dst_rect, &src_rect, DISPMANX_NO_HANDLE, DISPMANX_NO_ROTATE); SDL_assert( ret == DISPMANX_SUCCESS ); /* Submit asynchronously, otherwise the peformance suffers a lot */ ret = vc_dispmanx_update_submit( update, 0, NULL ); SDL_assert( ret == DISPMANX_SUCCESS ); } } return -1; /* !!! FIXME: this should SDL_SetError() somewhere. */ }