From 59b94eb7d178ddca0d3aa371043c873aa7eca8a7 Mon Sep 17 00:00:00 2001 From: William McBrine Date: Thu, 5 Apr 2007 08:06:15 +0000 Subject: [PATCH] The scroll-up-on-shell problem really needs to be fixed on the PDCurses end, and this is that fix. To Do: This isn't symmetrical; also, the regular use of resize_term() needs to be fixed for 9x. --- win32/pdcscrn.c | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/win32/pdcscrn.c b/win32/pdcscrn.c index 8ee0d7dd..f4713d7b 100644 --- a/win32/pdcscrn.c +++ b/win32/pdcscrn.c @@ -13,7 +13,7 @@ #include "pdcwin.h" -RCSID("$Id: pdcscrn.c,v 1.79 2007/01/10 15:57:35 wmcbrine Exp $"); +RCSID("$Id: pdcscrn.c,v 1.80 2007/04/05 08:06:15 wmcbrine Exp $"); #define PDC_RESTORE_NONE 0 #define PDC_RESTORE_BUFFER 1 @@ -415,18 +415,6 @@ int PDC_scr_open(int argc, char **argv) SP->_preserve = (getenv("PDC_PRESERVE_SCREEN") != NULL); - bufsize.X = orig_scr.srWindow.Right - orig_scr.srWindow.Left + 1; - bufsize.Y = orig_scr.srWindow.Bottom - orig_scr.srWindow.Top + 1; - - rect.Top = rect.Left = 0; - rect.Bottom = bufsize.Y - 1; - rect.Right = bufsize.X - 1; - - SetConsoleScreenBufferSize(pdc_con_out, bufsize); - SetConsoleWindowInfo(pdc_con_out, TRUE, &rect); - SetConsoleScreenBufferSize(pdc_con_out, bufsize); - SetConsoleActiveScreenBuffer(pdc_con_out); - PDC_reset_prog_mode(); SP->mono = FALSE; @@ -515,6 +503,26 @@ void PDC_reset_prog_mode(void) { PDC_LOG(("PDC_reset_prog_mode() - called.\n")); + if (is_nt) + { + COORD bufsize; + SMALL_RECT rect; + + bufsize.X = orig_scr.srWindow.Right - + orig_scr.srWindow.Left + 1; + bufsize.Y = orig_scr.srWindow.Bottom - + orig_scr.srWindow.Top + 1; + + rect.Top = rect.Left = 0; + rect.Bottom = bufsize.Y - 1; + rect.Right = bufsize.X - 1; + + SetConsoleScreenBufferSize(pdc_con_out, bufsize); + SetConsoleWindowInfo(pdc_con_out, TRUE, &rect); + SetConsoleScreenBufferSize(pdc_con_out, bufsize); + SetConsoleActiveScreenBuffer(pdc_con_out); + } + PDC_mouse_set(); }