Fix window manager redraw problem with multi-tasking and large images
This commit is contained in:
parent
a171f917d3
commit
28f4ac22ce
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user