From 8a9eebda2647a90ccd5c9650fa46c77d47974f89 Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Tue, 25 Aug 2009 03:12:18 +0200 Subject: [PATCH] narrow tolerance for very small screen --- src/ncmpcpp.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/ncmpcpp.cpp b/src/ncmpcpp.cpp index 612983a9..ae30c544 100644 --- a/src/ncmpcpp.cpp +++ b/src/ncmpcpp.cpp @@ -418,16 +418,15 @@ int main(int argc, char *argv[]) # endif // USE_PDCURSES RedrawHeader = 1; - - if (COLS < 20 || LINES < 5) - { - endwin(); - std::cout << "Screen too small!\n"; - return 1; - } - MainHeight = LINES-(Config.new_design ? 7 : 4); + if (COLS < 20 || MainHeight < 3) + { + DestroyScreen(); + std::cout << "Screen is too small!\n"; + exit(1); + } + if (!Config.header_visibility) MainHeight += 2; if (!Config.statusbar_visibility)