diff options
author | inmarket <inmarket@ugfx.org> | 2017-01-09 10:22:55 +1000 |
---|---|---|
committer | inmarket <inmarket@ugfx.org> | 2017-01-09 10:22:55 +1000 |
commit | 28f4ac22ce67e90190dd868c532846da57676968 (patch) | |
tree | c63ff73d8f2fa4439893566e4341e0c333ddb4da /src/gwin/gwin_wm.c | |
parent | a171f917d373f3ff527976c9c34725c0faaf6716 (diff) | |
download | uGFX-28f4ac22ce67e90190dd868c532846da57676968.tar.gz uGFX-28f4ac22ce67e90190dd868c532846da57676968.tar.bz2 uGFX-28f4ac22ce67e90190dd868c532846da57676968.zip |
Fix window manager redraw problem with multi-tasking and large images
Diffstat (limited to 'src/gwin/gwin_wm.c')
-rw-r--r-- | src/gwin/gwin_wm.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/gwin/gwin_wm.c b/src/gwin/gwin_wm.c index 3f50b4fc..c0ea8d25 100644 --- a/src/gwin/gwin_wm.c +++ b/src/gwin/gwin_wm.c @@ -746,18 +746,23 @@ static void WM_Delete(GHandle gh) { } static void WM_Redraw(GHandle gh) { + uint32_t flags; + + flags = gh->flags; + gh->flags &= ~(GWIN_FLG_NEEDREDRAW|GWIN_FLG_BGREDRAW|GWIN_FLG_PARENTREVEAL); + #if GWIN_NEED_CONTAINERS redo_redraw: #endif - if ((gh->flags & GWIN_FLG_SYSVISIBLE)) { + if ((flags & GWIN_FLG_SYSVISIBLE)) { if (gh->vmt->Redraw) gh->vmt->Redraw(gh); - else if ((gh->flags & GWIN_FLG_BGREDRAW)) { + else if ((flags & GWIN_FLG_BGREDRAW)) { // We can't redraw but we want full coverage so just clear the area gdispGFillArea(gh->display, gh->x, gh->y, gh->width, gh->height, gh->bgcolor); // Only do an after clear if this is not a parent reveal - if (!(gh->flags & GWIN_FLG_PARENTREVEAL) && gh->vmt->AfterClear) + if (!(flags & GWIN_FLG_PARENTREVEAL) && gh->vmt->AfterClear) gh->vmt->AfterClear(gh); } @@ -765,10 +770,9 @@ static void WM_Redraw(GHandle gh) { // If this is container but not a parent reveal, mark any visible children for redraw // We redraw our children here as we have overwritten them in redrawing the parent // as GDISP/GWIN doesn't support complex clipping regions. - if ((gh->flags & (GWIN_FLG_CONTAINER|GWIN_FLG_PARENTREVEAL)) == GWIN_FLG_CONTAINER) { + if ((flags & (GWIN_FLG_CONTAINER|GWIN_FLG_PARENTREVEAL)) == GWIN_FLG_CONTAINER) { // Container redraw is done - gh->flags &= ~(GWIN_FLG_NEEDREDRAW|GWIN_FLG_BGREDRAW|GWIN_FLG_PARENTREVEAL); for(gh = gwinGetFirstChild(gh); gh; gh = gwinGetSibling(gh)) _gwinUpdate(gh); @@ -777,14 +781,12 @@ static void WM_Redraw(GHandle gh) { #endif } else { - if ((gh->flags & GWIN_FLG_BGREDRAW)) { + if ((flags & GWIN_FLG_BGREDRAW)) { GHandle gx; #if GWIN_NEED_CONTAINERS if (gh->parent) { // Child redraw is done - gh->flags &= ~(GWIN_FLG_NEEDREDRAW|GWIN_FLG_BGREDRAW|GWIN_FLG_PARENTREVEAL); - // Get the parent to redraw the area gh = gh->parent; @@ -817,9 +819,6 @@ static void WM_Redraw(GHandle gh) { } } - - // Redraw is done - gh->flags &= ~(GWIN_FLG_NEEDREDRAW|GWIN_FLG_BGREDRAW|GWIN_FLG_PARENTREVEAL); } static void WM_Size(GHandle gh, coord_t w, coord_t h) { |