aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndrew Hannam <Andrew Hannam>2016-07-25 19:26:28 +1000
committerAndrew Hannam <Andrew Hannam>2016-07-25 19:26:28 +1000
commitdded46b567c21be30b0044bc1e332c0b0028feb7 (patch)
tree8b0311eece124ac8a53d63f16fd76fa03d133dcc /src
parent9fe1abe9e3155445a1c7db8ddad7169f7d52f937 (diff)
downloaduGFX-dded46b567c21be30b0044bc1e332c0b0028feb7.tar.gz
uGFX-dded46b567c21be30b0044bc1e332c0b0028feb7.tar.bz2
uGFX-dded46b567c21be30b0044bc1e332c0b0028feb7.zip
FIx bug where WM_Raise doesn't raise children if the parent is raised.
Diffstat (limited to 'src')
-rw-r--r--src/gwin/gwin_wm.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/gwin/gwin_wm.c b/src/gwin/gwin_wm.c
index 6bc5013b..ee951335 100644
--- a/src/gwin/gwin_wm.c
+++ b/src/gwin/gwin_wm.c
@@ -988,6 +988,35 @@ static void WM_Raise(GHandle gh) {
gfxQueueASyncRemove(&_GWINList, &gh->wmq);
gfxQueueASyncPut(&_GWINList, &gh->wmq);
+ #if GWIN_NEED_CONTAINERS
+ // Any children need to be moved
+ if ((gh->flags & GWIN_FLG_CONTAINER)) {
+ GHandle child;
+ bool_t restart;
+
+ // Raise the children too.
+ // Note children can also have their own children so after each move required we have to start again.
+ for(gh = gwinGetNextWindow(0); gh; gh = gwinGetNextWindow(gh)) {
+ if ((gh->flags & GWIN_FLG_CONTAINER)) {
+ restart = FALSE;
+ for(child = gwinGetNextWindow(0); child && child != gh; child = gwinGetNextWindow(child)) {
+ if (child->parent == gh) {
+ // Oops - this child is behind its parent
+ gfxQueueASyncRemove(&_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.
+ // We also need to restart everything once this container is done.
+ restart = TRUE;
+ }
+ }
+ if (restart)
+ gh = 0;
+ }
+ }
+ }
+ #endif
+
// Redraw the window
_gwinUpdate(gh);
}