]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/base/lib_refresh.c
ncurses 6.3 - patch 20211115
[ncurses.git] / ncurses / base / lib_refresh.c
index 8c02086a707d34302e3d96182974436ba7b1859c..4579cbf81162053c2a8284120e4c85cf2afc9000 100644 (file)
@@ -1,5 +1,6 @@
 /****************************************************************************
- * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc.              *
+ * Copyright 2020,2021 Thomas E. Dickey                                     *
+ * Copyright 1998-2010,2011 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -42,7 +43,7 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_refresh.c,v 1.44 2010/12/19 01:22:58 tom Exp $")
+MODULE_ID("$Id: lib_refresh.c,v 1.47 2021/11/06 22:22:03 tom Exp $")
 
 NCURSES_EXPORT(int)
 wrefresh(WINDOW *win)
@@ -90,6 +91,22 @@ wnoutrefresh(WINDOW *win)
 #endif
 
     T((T_CALLED("wnoutrefresh(%p)"), (void *) win));
+
+    if (win == NULL)
+       returnCode(ERR);
+
+    /*
+     * Handle pads as a special case.
+     */
+    if (IS_PAD(win)) {
+       returnCode(pnoutrefresh(win,
+                               win->_pad._pad_y,
+                               win->_pad._pad_x,
+                               win->_pad._pad_top,
+                               win->_pad._pad_left,
+                               win->_pad._pad_bottom,
+                               win->_pad._pad_right));
+    }
 #ifdef TRACE
     if (USE_TRACEF(TRACE_UPDATE)) {
        _tracedump("...win", win);
@@ -97,13 +114,6 @@ wnoutrefresh(WINDOW *win)
     }
 #endif /* TRACE */
 
-    /*
-     * This function will break badly if we try to refresh a pad.
-     */
-    if ((win == 0)
-       || (win->_flags & _ISPAD))
-       returnCode(ERR);
-
     /* put them here so "win == 0" won't break our code */
     begx = win->_begx;
     begy = win->_begy;