diff --git a/src/musikcube/cursespp/App.cpp b/src/musikcube/cursespp/App.cpp index acde685b8..278eac496 100755 --- a/src/musikcube/cursespp/App.cpp +++ b/src/musikcube/cursespp/App.cpp @@ -63,6 +63,7 @@ using namespace std::chrono; static OverlayStack overlays; static bool disconnected = false; +static bool resized = false; static App* instance = nullptr; @@ -71,6 +72,11 @@ static void hangupHandler(int signal) { disconnected = true; } +static void resizedHandler(int signal) { + endwin(); /* required in *nix because? */ + resized = true; +} + static std::string getEnvironmentVariable(const std::string& name) { std::string result; const char* value = std::getenv(name.c_str()); @@ -249,6 +255,7 @@ App::App(const std::string& title) { #else setlocale(LC_ALL, ""); std::signal(SIGHUP, hangupHandler); + std::signal(SIGWINCH, resizedHandler); std::signal(SIGPIPE, SIG_IGN); this->colorMode = Colors::Palette; #endif @@ -501,7 +508,6 @@ void App::Run(ILayoutPtr layout) { this->state.keyHandler = nullptr; int lastWidth = Screen::GetWidth(); int lastHeight = Screen::GetHeight(); - bool resized = false; this->ChangeLayout(layout);