From 5a3a2fbbf1eccf9dcd10b3c207be8921ea4330f8 Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Sat, 2 May 2015 20:43:19 +0200 Subject: [PATCH] set SIGWINCH handler before initializing ncurses to avoid races --- NEWS | 1 + src/ncmpcpp.cpp | 14 +++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/NEWS b/NEWS index 4433a568..79d648de 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,7 @@ ncmpcpp-0.6.4 (????-??-??) * Fix title of a pop-up which shows during adding selected items to the current playlist. * Correctly deal with leading separator while parsing filenames in tag editor. +* Fix initial incorrect window size that was occuring in some cases. ncmpcpp-0.6.3 (2015-03-02) diff --git a/src/ncmpcpp.cpp b/src/ncmpcpp.cpp index db7d7007..c53a0fb9 100644 --- a/src/ncmpcpp.cpp +++ b/src/ncmpcpp.cpp @@ -111,6 +111,13 @@ int main(int argc, char **argv) cerr_buffer = std::cerr.rdbuf(); std::cerr.rdbuf(errorlog.rdbuf()); +# ifndef WIN32 + signal(SIGPIPE, sighandler); + signal(SIGWINCH, sighandler); + // ignore Ctrl-C + sigignore(SIGINT); +# endif // !WIN32 + NC::initScreen("ncmpcpp ver. " VERSION, Config.colors_enabled); Actions::OriginalStatusbarVisibility = Config.statusbar_visibility; @@ -146,13 +153,6 @@ int main(int argc, char **argv) if (Config.mouse_support) mousemask(ALL_MOUSE_EVENTS, 0); -# ifndef WIN32 - signal(SIGPIPE, sighandler); - signal(SIGWINCH, sighandler); - // ignore Ctrl-C - sigignore(SIGINT); -# endif // !WIN32 - while (!Actions::ExitMainLoop) { try