The test below fails with the ncurses menu package because newpad() sets window origin -1, -1 and post_menu() creates a subpad that is the same size as the pad [which also seems a bit odd].
/* make sure window fits inside the original one */
if ((begy < orig->_begy) || (begx < orig->_begx) ||
(begy + nlines) > (orig->_begy + orig->_maxy) ||
(begx + ncols) > (orig->_begx + orig->_maxx))
return (WINDOW *)NULL;