Skip to content

Commit c080d04

Browse files
committed
Symmetry between PDC_reset_shell_mode() and PDC_reset_prog_mode() in
Win32. Much, much more to do here... the only question is whether I want to do it now, or wait until after the next release.
1 parent a865884 commit c080d04

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

win32/pdcscrn.c

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
#include "pdcwin.h"
1515

16-
RCSID("$Id: pdcscrn.c,v 1.81 2007/04/18 02:26:19 wmcbrine Exp $");
16+
RCSID("$Id: pdcscrn.c,v 1.82 2007/05/02 01:31:38 wmcbrine Exp $");
1717

1818
enum { PDC_RESTORE_NONE, PDC_RESTORE_BUFFER, PDC_RESTORE_WINDOW };
1919

@@ -222,10 +222,7 @@ void PDC_scr_close(void)
222222

223223
PDC_LOG(("PDC_scr_close() - called\n"));
224224

225-
SetConsoleScreenBufferSize(pdc_con_out, orig_scr.dwSize);
226-
SetConsoleWindowInfo(pdc_con_out, TRUE, &orig_scr.srWindow);
227-
SetConsoleScreenBufferSize(pdc_con_out, orig_scr.dwSize);
228-
SetConsoleWindowInfo(pdc_con_out, TRUE, &orig_scr.srWindow);
225+
PDC_reset_shell_mode();
229226

230227
if (SP->_restore != PDC_RESTORE_NONE)
231228
{
@@ -250,9 +247,6 @@ void PDC_scr_close(void)
250247
return;
251248
}
252249

253-
SetConsoleActiveScreenBuffer(pdc_con_out);
254-
SetConsoleMode(pdc_con_in, old_console_mode);
255-
256250
if (SP->visibility != 1)
257251
curs_set(1);
258252

@@ -528,6 +522,15 @@ void PDC_reset_shell_mode(void)
528522
{
529523
PDC_LOG(("PDC_reset_shell_mode() - called.\n"));
530524

525+
if (is_nt)
526+
{
527+
SetConsoleScreenBufferSize(pdc_con_out, orig_scr.dwSize);
528+
SetConsoleWindowInfo(pdc_con_out, TRUE, &orig_scr.srWindow);
529+
SetConsoleScreenBufferSize(pdc_con_out, orig_scr.dwSize);
530+
SetConsoleWindowInfo(pdc_con_out, TRUE, &orig_scr.srWindow);
531+
SetConsoleActiveScreenBuffer(pdc_con_out);
532+
}
533+
531534
SetConsoleMode(pdc_con_in, old_console_mode);
532535
}
533536

0 commit comments

Comments
 (0)