summaryrefslogtreecommitdiffstats
path: root/lib/libncurses/lib_refresh.c
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1997-07-30 17:21:39 +0000
committerache <ache@FreeBSD.org>1997-07-30 17:21:39 +0000
commitd6cf2089bc5887f137a83ede9767e5154e3b8186 (patch)
tree2eda095cc49ccd84c07771c2714cb72c8d3a931c /lib/libncurses/lib_refresh.c
parent2d46d6b6b7899598c975cea266468603c9a442ba (diff)
downloadFreeBSD-src-d6cf2089bc5887f137a83ede9767e5154e3b8186.zip
FreeBSD-src-d6cf2089bc5887f137a83ede9767e5154e3b8186.tar.gz
Fix logical background handling by merging it from ncurses 4.1
No new user-visible functions added
Diffstat (limited to 'lib/libncurses/lib_refresh.c')
-rw-r--r--lib/libncurses/lib_refresh.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/libncurses/lib_refresh.c b/lib/libncurses/lib_refresh.c
index 72ab095..9948025 100644
--- a/lib/libncurses/lib_refresh.c
+++ b/lib/libncurses/lib_refresh.c
@@ -40,6 +40,23 @@ int m, n;
T(("wnoutrefresh(%x) called", win));
+ /*
+ * This function will break badly if we try to refresh a pad.
+ */
+ if ((win == 0)
+ || (win->_flags & _ISPAD))
+ return(ERR);
+
+ /*
+ * If 'newscr' has a different background than the window that we're
+ * trying to refresh, we'll have to copy the whole thing.
+ */
+ if (win->_bkgd != newscr->_bkgd) {
+ touchwin(win);
+ newscr->_bkgd = win->_bkgd;
+ }
+ newscr->_attrs = win->_attrs;
+
win->_flags &= ~_HASMOVED;
for (i = 0, m = begy; i <= win->_maxy; i++, m++) {
if (win->_firstchar[i] != _NOCHANGE) {
OpenPOWER on IntegriCloud