Fix window manager redraw problem with multi-tasking and large images
This commit is contained in:
parent
a171f917d3
commit
28f4ac22ce
1 changed files with 10 additions and 11 deletions
|
@ -746,18 +746,23 @@ static void WM_Delete(GHandle gh) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void WM_Redraw(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
|
#if GWIN_NEED_CONTAINERS
|
||||||
redo_redraw:
|
redo_redraw:
|
||||||
#endif
|
#endif
|
||||||
if ((gh->flags & GWIN_FLG_SYSVISIBLE)) {
|
if ((flags & GWIN_FLG_SYSVISIBLE)) {
|
||||||
if (gh->vmt->Redraw)
|
if (gh->vmt->Redraw)
|
||||||
gh->vmt->Redraw(gh);
|
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
|
// 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);
|
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
|
// 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);
|
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
|
// 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
|
// We redraw our children here as we have overwritten them in redrawing the parent
|
||||||
// as GDISP/GWIN doesn't support complex clipping regions.
|
// 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
|
// Container redraw is done
|
||||||
gh->flags &= ~(GWIN_FLG_NEEDREDRAW|GWIN_FLG_BGREDRAW|GWIN_FLG_PARENTREVEAL);
|
|
||||||
|
|
||||||
for(gh = gwinGetFirstChild(gh); gh; gh = gwinGetSibling(gh))
|
for(gh = gwinGetFirstChild(gh); gh; gh = gwinGetSibling(gh))
|
||||||
_gwinUpdate(gh);
|
_gwinUpdate(gh);
|
||||||
|
@ -777,14 +781,12 @@ static void WM_Redraw(GHandle gh) {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if ((gh->flags & GWIN_FLG_BGREDRAW)) {
|
if ((flags & GWIN_FLG_BGREDRAW)) {
|
||||||
GHandle gx;
|
GHandle gx;
|
||||||
|
|
||||||
#if GWIN_NEED_CONTAINERS
|
#if GWIN_NEED_CONTAINERS
|
||||||
if (gh->parent) {
|
if (gh->parent) {
|
||||||
// Child redraw is done
|
// Child redraw is done
|
||||||
gh->flags &= ~(GWIN_FLG_NEEDREDRAW|GWIN_FLG_BGREDRAW|GWIN_FLG_PARENTREVEAL);
|
|
||||||
|
|
||||||
|
|
||||||
// Get the parent to redraw the area
|
// Get the parent to redraw the area
|
||||||
gh = gh->parent;
|
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) {
|
static void WM_Size(GHandle gh, coord_t w, coord_t h) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue