From 8b56476a2c4125e6deda36edff179f92972b7bb3 Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Wed, 7 Apr 2021 06:59:23 -0400 Subject: list: After drawing scrollbars, explcitly switch back to old viewport. The viewport used for the scrollbar is allocated on the stack, and falls out of scope before the next call to set_viewport(), which sets a flag in the now-out-of-scope "last" viewport. Change-Id: I2c8bfcff500d189fa3857411aadc2e16aa545d2c --- apps/gui/bitmap/list.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/gui/bitmap/list.c b/apps/gui/bitmap/list.c index aeaceb2780..6f6a8c1f7f 100644 --- a/apps/gui/bitmap/list.c +++ b/apps/gui/bitmap/list.c @@ -203,11 +203,12 @@ void list_draw(struct screen *display, struct gui_synclist *list) vp.x += list_text_vp->width; else /* left */ list_text_vp->x += SCROLLBAR_WIDTH; - display->set_viewport(&vp); + struct viewport *last = display->set_viewport(&vp); gui_scrollbar_draw(display, (scrollbar_in_left? 0: 1), 0, SCROLLBAR_WIDTH-1, vp.height, list->nb_items, list_start_item, list_start_item + nb_lines, VERTICAL); + display->set_viewport(last); } /* shift everything a bit in relation to the title */ else if (!VP_IS_RTL(list_text_vp) && scrollbar_in_left) -- cgit v1.2.3