Correct an NX error that would leave stuff on the display when a window is closed
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3769 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
fcb3f0be7c
commit
be05281b7a
|
@ -115,6 +115,31 @@ NXHANDLE g_bgwnd;
|
||||||
* Private Functions
|
* Private Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Name: nxbg_redrawrect
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
static void nxbg_redrawrect(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect)
|
||||||
|
{
|
||||||
|
int ret;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
ret = nx_fill(hwnd, rect, g_bgstate.wcolor);
|
||||||
|
if (ret < 0)
|
||||||
|
{
|
||||||
|
message("nxbg_redrawrect: nx_fill failed: %d\n", errno);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Fill each character on the display (Only the characters within rect
|
||||||
|
* will actually be redrawn).
|
||||||
|
*/
|
||||||
|
|
||||||
|
for (i = 0; i < g_bgstate.nchars; i++)
|
||||||
|
{
|
||||||
|
nxtext_fillchar(hwnd, rect, &g_bgstate, &g_bgstate.bm[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: nxbg_redraw
|
* Name: nxbg_redraw
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
@ -290,7 +315,7 @@ static inline void nxbg_movedisplay(NXWINDOW hwnd, int bottom, int lineheight)
|
||||||
ret = nx_move(hwnd, &rect, &offset);
|
ret = nx_move(hwnd, &rect, &offset);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
message("nxbg_redrawrect: nx_move failed: %d\n", errno);
|
message("nxbg_movedisplay: nx_move failed: %d\n", errno);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -440,31 +465,3 @@ void nxbg_write(NXWINDOW hwnd, FAR const uint8_t *buffer, size_t buflen)
|
||||||
nxtext_putc(hwnd, &g_bgstate, (uint8_t)*buffer++);
|
nxtext_putc(hwnd, &g_bgstate, (uint8_t)*buffer++);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Name: nxbg_redrawrect
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
void nxbg_redrawrect(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect)
|
|
||||||
{
|
|
||||||
int ret;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
ret = nx_fill(hwnd, rect, g_bgstate.wcolor);
|
|
||||||
if (ret < 0)
|
|
||||||
{
|
|
||||||
message("nxbg_redrawrect: nx_fill failed: %d\n", errno);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Fill each character on the display (Only the characters within rect
|
|
||||||
* will actually be redrawn).
|
|
||||||
*/
|
|
||||||
|
|
||||||
for (i = 0; i < g_bgstate.nchars; i++)
|
|
||||||
{
|
|
||||||
nxtext_fillchar(hwnd, rect, &g_bgstate, &g_bgstate.bm[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -295,7 +295,6 @@ extern FAR void *nxtext_listener(FAR void *arg);
|
||||||
|
|
||||||
extern FAR struct nxtext_state_s *nxbg_getstate(void);
|
extern FAR struct nxtext_state_s *nxbg_getstate(void);
|
||||||
extern void nxbg_write(NXWINDOW hwnd, FAR const uint8_t *buffer, size_t buflen);
|
extern void nxbg_write(NXWINDOW hwnd, FAR const uint8_t *buffer, size_t buflen);
|
||||||
extern void nxbg_redrawrect(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect);
|
|
||||||
|
|
||||||
/* Pop-up window interfaces */
|
/* Pop-up window interfaces */
|
||||||
|
|
||||||
|
|
|
@ -395,7 +395,6 @@ errout_with_state:
|
||||||
|
|
||||||
int nxpu_close(NXWINDOW hwnd)
|
int nxpu_close(NXWINDOW hwnd)
|
||||||
{
|
{
|
||||||
struct nxgl_rect_s rect;
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = nx_closewindow(hwnd);
|
ret = nx_closewindow(hwnd);
|
||||||
|
@ -405,19 +404,5 @@ int nxpu_close(NXWINDOW hwnd)
|
||||||
g_exitcode = NXEXIT_NXCLOSEWINDOW;
|
g_exitcode = NXEXIT_NXCLOSEWINDOW;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* NOTE: The following should not be necessary. This is
|
|
||||||
* a temporary workaround for a bug in the TODO list:
|
|
||||||
* "When a window is closed, the display is not updated."
|
|
||||||
*/
|
|
||||||
|
|
||||||
rect.pt1.x = g_pustate.wpos.x;
|
|
||||||
rect.pt1.y = g_pustate.wpos.y;
|
|
||||||
rect.pt2.x = g_pustate.wpos.x + g_pustate.wsize.w - 1;
|
|
||||||
rect.pt2.y = g_pustate.wpos.y + g_pustate.wsize.h - 1;
|
|
||||||
gvdbg("pt1(%d,%d) pt2(%d,%d)\n",
|
|
||||||
rect.pt1.x, rect.pt1.y, rect.pt2.x, rect.pt2.y);
|
|
||||||
|
|
||||||
nxbg_redrawrect(g_bgwnd, &rect);
|
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1892,3 +1892,6 @@
|
||||||
* graphics/nxbe/nxbe_move.c: Fixed an error in the graphics move logic (This
|
* graphics/nxbe/nxbe_move.c: Fixed an error in the graphics move logic (This
|
||||||
was a previously untested interface). Basically, there is some confusion
|
was a previously untested interface). Basically, there is some confusion
|
||||||
between use of (x,y) as a relative offset or as an absolute position.
|
between use of (x,y) as a relative offset or as an absolute position.
|
||||||
|
* graphics/nxbe/nxbe_close.c: Fixed an important graphics system bug:
|
||||||
|
When a window is closed, the display was not being updated. The old
|
||||||
|
window graphic was left on the display for a time.
|
||||||
|
|
|
@ -14,7 +14,7 @@ nuttx/
|
||||||
(2) USB (drivers/usbdev, drivers/usbhost)
|
(2) USB (drivers/usbdev, drivers/usbhost)
|
||||||
(6) Libraries (lib/)
|
(6) Libraries (lib/)
|
||||||
(13) File system/Generic drivers (fs/, drivers/)
|
(13) File system/Generic drivers (fs/, drivers/)
|
||||||
(2) Graphics subystem (graphics/)
|
(1) Graphics subystem (graphics/)
|
||||||
(1) Pascal add-on (pcode/)
|
(1) Pascal add-on (pcode/)
|
||||||
(1) Documentation (Documentation/)
|
(1) Documentation (Documentation/)
|
||||||
(4) Build system / Toolchains
|
(4) Build system / Toolchains
|
||||||
|
@ -484,10 +484,6 @@ o Graphics subystem (graphics/)
|
||||||
Status: Open
|
Status: Open
|
||||||
Priority: Medium
|
Priority: Medium
|
||||||
|
|
||||||
Description: When a window is closed, the display is not updated.
|
|
||||||
Status: Open
|
|
||||||
Priority: High
|
|
||||||
|
|
||||||
o Pascal Add-On (pcode/)
|
o Pascal Add-On (pcode/)
|
||||||
^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
|
|
@ -104,7 +104,7 @@ void nxbe_closewindow(struct nxbe_window_s *wnd)
|
||||||
|
|
||||||
if (wnd->above)
|
if (wnd->above)
|
||||||
{
|
{
|
||||||
/* Yes, now the window below that on is the window below
|
/* Yes, now the window below that one is the window below
|
||||||
* the one being closed.
|
* the one being closed.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -126,5 +126,12 @@ void nxbe_closewindow(struct nxbe_window_s *wnd)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
wnd->below->above = wnd->above;
|
wnd->below->above = wnd->above;
|
||||||
|
|
||||||
|
/* Redraw the windows that were below us (and may now be exposed) */
|
||||||
|
|
||||||
|
nxbe_redrawbelow(be, wnd->below, &wnd->bounds);
|
||||||
|
|
||||||
|
/* Then discard the window structure */
|
||||||
|
|
||||||
free(wnd);
|
free(wnd);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue