1
0
Fork 0
forked from len0rd/rockbox

skin_engine: kill scrolling if the buffer moves

I have a suspicion that if there is any scrolling skin lines when
the buflib buffer moves it will cause the lcd code to crash.

This *hopefully* explains the random skin related crashed which
have been reported.

Change-Id: I04ee58292e1cea7c77ef9737b0641192f4f7e4ba
Reviewed-on: http://gerrit.rockbox.org/877
Reviewed-by: Thomas Martitz <kugel@rockbox.org>
This commit is contained in:
Jonathan Gordon 2014-06-19 19:46:36 +10:00 • committed by Thomas Martitz
parent 7d62f81770
commit 7b377d29fb

View file

@ -1752,6 +1752,16 @@ static int buflib_move_callback(int handle, void* current, void* new)
(void)new;
if (handle == currently_loading_handle)
return BUFLIB_CB_CANNOT_MOVE;
/* Any active skins may be scrolling - which means using viewports which
* will be moved after this callback returns. This is a hammer to make that
* safe. TODO: use a screwdriver instead.
*/
FOR_NB_SCREENS(i)
screens[i].scroll_stop();
for (int i = 0; i < SKINNABLE_SCREENS_COUNT; i++)
skin_request_full_update(i);
return BUFLIB_CB_OK;
}
static struct buflib_callbacks buflib_ops = {buflib_move_callback, NULL, NULL};