mirror of
https://github.com/apache/nuttx.git
synced 2025-01-13 12:08:36 +08:00
graphics/nxbe/nxbe_raise.c: Fix a critical list handling bug in the grahics system. When a lower-level window was raised while a model window was in place, then list corruption could occur.
This commit is contained in:
parent
ad8dc791ef
commit
5a41056a2f
3 changed files with 15 additions and 6 deletions
|
@ -98,7 +98,9 @@ void nxbe_lower(FAR struct nxbe_window_s *wnd)
|
||||||
|
|
||||||
below = wnd->below;
|
below = wnd->below;
|
||||||
|
|
||||||
/* Then put the lowered window at the bottom (just above the background window) */
|
/* Then put the lowered window at the bottom (just above the background
|
||||||
|
* window).
|
||||||
|
*/
|
||||||
|
|
||||||
wnd->below = &be->bkgd;
|
wnd->below = &be->bkgd;
|
||||||
wnd->above = be->bkgd.above;
|
wnd->above = be->bkgd.above;
|
||||||
|
|
|
@ -110,17 +110,24 @@ void nxbe_raise(FAR struct nxbe_window_s *wnd)
|
||||||
|
|
||||||
if (NXBE_STATE_ISMODAL(be) && be->topwnd->below != NULL)
|
if (NXBE_STATE_ISMODAL(be) && be->topwnd->below != NULL)
|
||||||
{
|
{
|
||||||
|
FAR struct nxbe_window_s *above;
|
||||||
|
FAR struct nxbe_window_s *below;
|
||||||
|
|
||||||
/* We are in a modal state. The topwnd is not the background and it
|
/* We are in a modal state. The topwnd is not the background and it
|
||||||
* has focus.
|
* has focus.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
wnd->above = be->topwnd;
|
above = be->topwnd;
|
||||||
wnd->below = be->topwnd->below;
|
below = be->topwnd->below;
|
||||||
|
|
||||||
be->topwnd->below = wnd;
|
wnd->above = above;
|
||||||
|
wnd->below = below;
|
||||||
|
|
||||||
|
above->below = wnd;
|
||||||
|
below->above = wnd;
|
||||||
|
|
||||||
/* Then redraw this window AND all windows below it. Having moved the
|
/* Then redraw this window AND all windows below it. Having moved the
|
||||||
* window, we may have exposed previoulsy obscured portions of windows
|
* window, we may have exposed previously obscured portions of windows
|
||||||
* below this one.
|
* below this one.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -88,7 +88,7 @@ void nxbe_setposition(FAR struct nxbe_window_s *wnd,
|
||||||
nxmu_reportposition(wnd);
|
nxmu_reportposition(wnd);
|
||||||
|
|
||||||
/* Then redraw this window AND all windows below it. Having moved the
|
/* Then redraw this window AND all windows below it. Having moved the
|
||||||
* window, we may have exposed previoulsy obscured portions of windows
|
* window, we may have exposed previously obscured portions of windows
|
||||||
* below this one.
|
* below this one.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue