X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=lib-ui%2Fresize.c;h=fe0e9655ed7fae74f5410bffb4fa109db390d86a;hp=74cd58c97c7213b4f4029c8f29aa6c3ba4137267;hb=84bc6d1930165b21919541b3b24294a9d99c3541;hpb=57352369229a00b32f5331cdd12f4ea1ace60f78;ds=sidebyside diff --git a/lib-ui/resize.c b/lib-ui/resize.c index 74cd58c..fe0e965 100644 --- a/lib-ui/resize.c +++ b/lib-ui/resize.c @@ -9,7 +9,7 @@ #include -#if defined(USE_SLANG_CURSES) || defined(HAVE_RESIZETERM) +#if defined(HAVE_RESIZETERM) #include #ifdef HAVE_SYS_IOCTL_H @@ -28,41 +28,31 @@ void mutt_resize_screen (void) int fd; struct winsize w; -#ifdef HAVE_RESIZETERM - int SLtt_Screen_Rows, SLtt_Screen_Cols; -#endif + int rows, cols; - SLtt_Screen_Rows = -1; - SLtt_Screen_Cols = -1; + rows = -1; + cols = -1; if ((fd = open ("/dev/tty", O_RDONLY)) != -1) { if (ioctl (fd, TIOCGWINSZ, &w) != -1) { - SLtt_Screen_Rows = w.ws_row; - SLtt_Screen_Cols = w.ws_col; + rows = w.ws_row; + cols = w.ws_col; } close (fd); } - if (SLtt_Screen_Rows <= 0) { + if (rows <= 0) { if ((cp = getenv ("LINES")) != NULL) { - SLtt_Screen_Rows = atoi (cp); + rows = atoi (cp); } else - SLtt_Screen_Rows = 24; + rows = 24; } - if (SLtt_Screen_Cols <= 0) { + if (cols <= 0) { if ((cp = getenv ("COLUMNS")) != NULL) - SLtt_Screen_Cols = atoi (cp); + cols = atoi (cp); else - SLtt_Screen_Cols = 80; + cols = 80; } -#ifdef USE_SLANG_CURSES - delwin (stdscr); - SLsmg_reset_smg (); - SLsmg_init_smg (); - stdscr = newwin (0, 0, 0, 0); - keypad (stdscr, TRUE); -#else - resizeterm (SLtt_Screen_Rows, SLtt_Screen_Cols); -#endif + resizeterm (rows, cols); } -#endif /* defined(USE_SLANG_CURSES) || defined(HAVE_RESIZETERM) */ +#endif /* defined(HAVE_RESIZETERM) */