mirror of
https://github.com/clangen/musikcube.git
synced 2025-01-03 23:39:41 +00:00
More cross-platform, cross-terminal-emulator resize compatibility fixes.
This commit is contained in:
parent
0951d87add
commit
5c7415bc45
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user