diff --git a/curses.h b/curses.h index 6584d5d3..24ee1395 100644 --- a/curses.h +++ b/curses.h @@ -28,7 +28,7 @@ Defined by this header: **man-end****************************************************************/ #define PDCURSES 1 /* PDCurses-only routines */ -#define PDC_BUILD 3805 +#define PDC_BUILD 3806 #define PDC_VER_MAJOR 3 #define PDC_VER_MINOR 8 #define PDC_VERDOT "3.8" @@ -357,6 +357,7 @@ typedef struct #endif short line_color; /* color of line attributes - default -1 */ attr_t termattrs; /* attribute capabilities */ + bool dirty; /* redraw on napms() after init_color() */ } SCREEN; /*---------------------------------------------------------------------- diff --git a/curspriv.h b/curspriv.h index 4f8e6981..5697a42d 100644 --- a/curspriv.h +++ b/curspriv.h @@ -47,7 +47,6 @@ extern FILE *pdc_dbfp; /* tracing file pointer (NULL = off) */ extern bool pdc_color_started; extern unsigned long pdc_key_modifiers; extern MOUSE_STATUS pdc_mouse_status; -extern bool pdc_dirty; /* redraw on napms() after init_color() */ /*----------------------------------------------------------------------*/ diff --git a/pdcurses/color.c b/pdcurses/color.c index 9ee5bf4e..98da8366 100644 --- a/pdcurses/color.c +++ b/pdcurses/color.c @@ -181,12 +181,12 @@ int init_color(short color, short red, short green, short blue) { PDC_LOG(("init_color() - called\n")); - if (color < 0 || color >= COLORS || !PDC_can_change_color() || + if (!SP || color < 0 || color >= COLORS || !PDC_can_change_color() || red < -1 || red > 1000 || green < -1 || green > 1000 || blue < -1 || blue > 1000) return ERR; - pdc_dirty = TRUE; + SP->dirty = TRUE; return PDC_init_color(color, red, green, blue); } diff --git a/pdcurses/initscr.c b/pdcurses/initscr.c index d4a2982f..56b92cea 100644 --- a/pdcurses/initscr.c +++ b/pdcurses/initscr.c @@ -149,6 +149,7 @@ WINDOW *Xinitscr(int argc, char *argv[]) SP->linesrippedoffontop = 0; SP->delaytenths = 0; SP->line_color = -1; + SP->dirty = FALSE; SP->orig_cursor = PDC_get_cursor_mode(); diff --git a/pdcurses/kernel.c b/pdcurses/kernel.c index 29b246f5..b7f626b9 100644 --- a/pdcurses/kernel.c +++ b/pdcurses/kernel.c @@ -87,7 +87,6 @@ kernel RIPPEDOFFLINE linesripped[5]; char linesrippedoff = 0; -bool pdc_dirty = FALSE; static struct cttyset { @@ -228,9 +227,9 @@ int napms(int ms) if (!SP) return ERR; - if (pdc_dirty) + if (SP->dirty) { - pdc_dirty = FALSE; + SP->dirty = FALSE; wrefresh(curscr); }