-/* $OpenBSD: lib_set_term.c,v 1.13 2010/01/12 23:22:06 nicm Exp $ */
+/* $OpenBSD: lib_set_term.c,v 1.14 2021/03/10 20:16:08 millert Exp $ */
/****************************************************************************
* Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. *
#include <term.h> /* cur_term */
#include <tic.h>
-MODULE_ID("$Id: lib_set_term.c,v 1.13 2010/01/12 23:22:06 nicm Exp $")
+MODULE_ID("$Id: lib_set_term.c,v 1.14 2021/03/10 20:16:08 millert Exp $")
NCURSES_EXPORT(SCREEN *)
set_term(SCREEN *screenp)
#endif
#if USE_SIZECHANGE
SP->_resize = resizeterm;
+ SP->_ungetch = _nc_ungetch;
#endif
newscr->_clear = TRUE;
-/* $OpenBSD: resizeterm.c,v 1.3 2010/01/12 23:22:06 nicm Exp $ */
+/* $OpenBSD: resizeterm.c,v 1.4 2021/03/10 20:16:08 millert Exp $ */
/****************************************************************************
* Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. *
#include <curses.priv.h>
#include <term.h>
-MODULE_ID("$Id: resizeterm.c,v 1.3 2010/01/12 23:22:06 nicm Exp $")
+MODULE_ID("$Id: resizeterm.c,v 1.4 2021/03/10 20:16:08 millert Exp $")
#define stolen_lines (screen_lines - SP->_lines_avail)
result = resize_term(ToLines, ToCols);
#if USE_SIGWINCH
- _nc_ungetch(SP, KEY_RESIZE); /* so application can know this */
clearok(curscr, TRUE); /* screen contents are unknown */
/* ripped-off lines are a special case: if we did not lengthen
}
#endif
}
+#if USE_SIGWINCH
+ _nc_ungetch(SP, KEY_RESIZE); /* so application can know this */
+#endif
}
returnCode(result);
'\" t
-.\" $OpenBSD: curs_getch.3,v 1.4 2019/02/13 07:18:57 nicm Exp $
+.\" $OpenBSD: curs_getch.3,v 1.5 2021/03/10 20:16:08 millert Exp $
.\"
.\"***************************************************************************
.\" Copyright (c) 1998-2005,2006 Free Software Foundation, Inc. *
.\" authorization. *
.\"***************************************************************************
.\"
-.\" $Id: curs_getch.3,v 1.4 2019/02/13 07:18:57 nicm Exp $
+.\" $Id: curs_getch.3,v 1.5 2021/03/10 20:16:08 millert Exp $
.TH curs_getch 3 ""
.na
.hy 0
All routines return the integer \fBERR\fR upon failure and an integer value
other than \fBERR\fR (\fBOK\fR in the case of ungetch()) upon successful
completion.
-.RS
+.RS 3
.TP 5
\fBungetch\fP
-returns an error
+returns ERR
if there is no more room in the FIFO.
-.TP 5
+.TP
\fBwgetch\fP
-returns an error
+returns ERR
if the window pointer is null, or
if its timeout expires without having any data.
.RE
-/* $OpenBSD: curses.priv.h,v 1.34 2010/09/06 17:26:17 nicm Exp $ */
+/* $OpenBSD: curses.priv.h,v 1.35 2021/03/10 20:16:08 millert Exp $ */
/****************************************************************************
* Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. *
/*
- * $Id: curses.priv.h,v 1.34 2010/09/06 17:26:17 nicm Exp $
+ * $Id: curses.priv.h,v 1.35 2021/03/10 20:16:08 millert Exp $
*
* curses.priv.h
*
*/
#if USE_SIZECHANGE
int (*_resize)(int,int);
+ int (*_ungetch)(SCREEN *, int);
#endif
/*
-.\" $OpenBSD: resizeterm.3,v 1.5 2010/01/12 23:21:59 nicm Exp $
+.\" $OpenBSD: resizeterm.3,v 1.6 2021/03/10 20:16:08 millert Exp $
.\"
.\"***************************************************************************
.\" Copyright (c) 1998-2003,2005 Free Software Foundation, Inc. *
.\"
.\" Author: Thomas E. Dickey 1996-2005
.\"
-.\" $Id: resizeterm.3,v 1.5 2010/01/12 23:21:59 nicm Exp $
+.\" $Id: resizeterm.3,v 1.6 2021/03/10 20:16:08 millert Exp $
.TH resizeterm 3 ""
.SH NAME
\fBis_term_resized\fR,
the operating system.
Thus, even if a SIGWINCH is received,
no screen size change may be recorded.
-In that case, no \fBKEY_RESIZE\fP is queued for the next call to \fBgetch\fP;
-an \fBERR\fP will be returned instead.
.SH SEE ALSO
\fBwresize\fR(3).
.SH AUTHOR
-/* $OpenBSD: lib_setup.c,v 1.12 2010/01/12 23:22:06 nicm Exp $ */
+/* $OpenBSD: lib_setup.c,v 1.13 2021/03/10 20:16:08 millert Exp $ */
/****************************************************************************
* Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. *
#include <term.h> /* lines, columns, cur_term */
-MODULE_ID("$Id: lib_setup.c,v 1.12 2010/01/12 23:22:06 nicm Exp $")
+MODULE_ID("$Id: lib_setup.c,v 1.13 2021/03/10 20:16:08 millert Exp $")
/****************************************************************************
*
*/
if (sp != 0
&& sp->_resize != 0) {
- if ((new_lines != old_lines) || (new_cols != old_cols))
+ if ((new_lines != old_lines) || (new_cols != old_cols)) {
sp->_resize(new_lines, new_cols);
+ } else if (sp->_sig_winch && (sp->_ungetch != 0)) {
+ sp->_ungetch(SP, KEY_RESIZE); /* so application can know this */
+ }
sp->_sig_winch = FALSE;
}
}