Fixing bug in WM_Raise()
This commit is contained in:
parent
dded46b567
commit
1853f9d014
1 changed files with 14 additions and 12 deletions
|
@ -989,29 +989,31 @@ static void WM_Raise(GHandle gh) {
|
||||||
gfxQueueASyncPut(&_GWINList, &gh->wmq);
|
gfxQueueASyncPut(&_GWINList, &gh->wmq);
|
||||||
|
|
||||||
#if GWIN_NEED_CONTAINERS
|
#if GWIN_NEED_CONTAINERS
|
||||||
// Any children need to be moved
|
// Any children need to be raised too
|
||||||
if ((gh->flags & GWIN_FLG_CONTAINER)) {
|
if ((gh->flags & GWIN_FLG_CONTAINER)) {
|
||||||
|
GHandle gx = gh;
|
||||||
GHandle child;
|
GHandle child;
|
||||||
bool_t restart;
|
bool_t restart;
|
||||||
|
|
||||||
// Raise the children too.
|
// Raise the children too
|
||||||
// Note children can also have their own children so after each move required we have to start again.
|
// Note: Children can also have their own children so after each move we have to start again.
|
||||||
for(gh = gwinGetNextWindow(0); gh; gh = gwinGetNextWindow(gh)) {
|
for (gx = gwinGetNextWindow(0); gx; gx = gwinGetNextWindow(gx)) {
|
||||||
if ((gh->flags & GWIN_FLG_CONTAINER)) {
|
if ((gx->flags & GWIN_FLG_CONTAINER)) {
|
||||||
restart = FALSE;
|
restart = FALSE;
|
||||||
for(child = gwinGetNextWindow(0); child && child != gh; child = gwinGetNextWindow(child)) {
|
for (child = gwinGetNextWindow(0); child && child != gx; child = gwinGetNextWindow(child)) {
|
||||||
if (child->parent == gh) {
|
if (child->parent == gx) {
|
||||||
// Oops - this child is behind its parent
|
// Oops - this child is behind its parent. Move it to the front.
|
||||||
gfxQueueASyncRemove(&_GWINList, &child->wmq);
|
gfxQueueASyncRemove(&_GWINList, &child->wmq);
|
||||||
gfxQueueASyncPut(&_GWINList, &child->wmq);
|
gfxQueueASyncPut(&_GWINList, &child->wmq);
|
||||||
// Continue the loop here effectively restarts at the front of the list
|
|
||||||
// for this parent container as we have moved this child to the start of the list.
|
// Restart at the front of the list for this parent container as we have moved this child
|
||||||
// We also need to restart everything once this container is done.
|
// to the end of the list. We also need to restart everything once this container is done.
|
||||||
|
child = 0;
|
||||||
restart = TRUE;
|
restart = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (restart)
|
if (restart)
|
||||||
gh = 0;
|
gx = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue