From 97fd3c0a40abdb973da17dd2dd835095fc232bb0 Mon Sep 17 00:00:00 2001 From: Jeff Armstrong Date: Wed, 5 Jul 2017 21:03:06 -0400 Subject: Fixed resize operations and makefile for better portability. Properly implemented Do_Size global variable. --- term.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'term.c') diff --git a/term.c b/term.c index 78055d6..42e6661 100644 --- a/term.c +++ b/term.c @@ -3247,6 +3247,10 @@ void Fast Conin() struct _KBDKEYINFO Key_Data; struct _NOPTRRECT No_Pointer; #endif +#if defined(UNIX) & !defined(TERMCAP) +int mx, my; +#endif + #if defined(DOS) & !(defined(Windows) | defined(TV)) int M1; #endif @@ -3303,8 +3307,9 @@ void Fast Conin() /* May be called if SIGWINCH fired */ if(Do_Size == 1) { - Phys_Length=Max_Length=Scr_Length=stdscr->_maxy+1; - Phys_Width=Max_Width=Scr_Width=stdscr->_maxx+1; + getmaxyx(stdscr, my, mx); + Phys_Length=Max_Length=Scr_Length=my+1; + Phys_Width=Max_Width=Scr_Width=mx+1; endwin(); refresh(); @@ -3683,13 +3688,11 @@ void Fast Setup_Term() case VT3XX: case VT4XX: Out_S("\033="); -#if defined(UNIX) {if (Use_Mouse) /* 290a */ Enable_Mouse(); Out_S("\033[1;3'{"); /* Select Button Up and Down Events*/ Gotmouse=1; } -#endif case VT1XX: case VK100: {Out_S("\033[?6l"); @@ -3706,6 +3709,8 @@ void Fast Setup_Term() Scl_Top = 0; Set_Scroll (1, Scr_Length); #else +int mx, my; + initscr(); nonl(); cbreak(); @@ -3715,9 +3720,9 @@ void Fast Setup_Term() /* For nonblocking getch() - unneeded if KEY_RESIZE is a thing */ timeout(0); #endif - - Max_Length=Scr_Length=stdscr->_maxy+1; - Max_Width=Scr_Width=stdscr->_maxx+1; + getmaxyx(stdscr, my, mx); + Max_Length=Scr_Length=my+1; + Max_Width=Scr_Width=mx+1; #endif #endif #if defined(VMS) -- cgit v1.2.3