From c8a57a4fe56f3245fcb57b55188c8a336340b078 Mon Sep 17 00:00:00 2001 From: "Andrey A. Chernov" Date: Wed, 30 Jul 1997 17:21:39 +0000 Subject: Fix logical background handling by merging it from ncurses 4.1 No new user-visible functions added --- lib/libncurses/lib_refresh.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'lib/libncurses/lib_refresh.c') diff --git a/lib/libncurses/lib_refresh.c b/lib/libncurses/lib_refresh.c index 72ab095d15b7..994802525a14 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) { -- cgit v1.2.3