apps/examples/nxterm: NxWM passed the size of the NxTK sub-window but nxterm example passed the size of the complete NxTK window. They must be made consistent.

This commit is contained in:
Gregory Nutt 2019-03-09 13:17:22 -06:00
parent 66af5b46dd
commit e063e93f77
2 changed files with 9 additions and 13 deletions

View File

@ -375,6 +375,12 @@ int nxterm_main(int argc, char **argv)
nxcreate.type = BOARDIOC_XTERM_FRAMED;
nxcreate.minor = CONFIG_EXAMPLES_NXTERM_MINOR;
/* BOARDIOC_NXTERM wants the size of the NxTK main sub-window */
nxcreate.wndo.wsize.w -= (2 * CONFIG_NXTK_BORDERWIDTH);
nxcreate.wndo.wsize.h -= (CONFIG_EXAMPLES_NXTERM_TOOLBAR_HEIGHT +
2 * CONFIG_NXTK_BORDERWIDTH);
ret = boardctl(BOARDIOC_NXTERM, (uintptr_t)&nxcreate);
if (ret < 0)
{

View File

@ -56,14 +56,6 @@
#include "nxterm_internal.h"
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Private Types
****************************************************************************/
/****************************************************************************
* Private Function Prototypes
****************************************************************************/
@ -84,10 +76,6 @@ static void nxwndo_kbdin(NXWINDOW hwnd, uint8_t nch, FAR const uint8_t *ch,
FAR void *arg);
#endif
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Public Data
****************************************************************************/
@ -174,7 +162,9 @@ static void nxwndo_position(NXWINDOW hwnd, FAR const struct nxgl_size_s *size,
g_nxterm_vars.wndo.wsize.w = size->w;
g_nxterm_vars.wndo.wsize.h = size->h;
/* Save the window limits (these should be the same for all places and all windows */
/* Save the window limits (these should be the same for all places and
* all windows)
*/
g_nxterm_vars.xres = bounds->pt2.x + 1;
g_nxterm_vars.yres = bounds->pt2.y + 1;