Commit e8bf828d authored by mbionchi's avatar mbionchi

fix winch issue

parent ad6dab31
......@@ -18,8 +18,6 @@
#ifndef _TELNET_SITE_SITE_H
#define _TELNET_SITE_SITE_H
#include <ncurses.h>
void site(char *site_path);
#endif
......@@ -32,13 +32,6 @@
void splash(char *path) {
struct window splash_window;
splash_window.window = initscr();
cbreak();
halfdelay(1);
noecho();
curs_set(0);
nonl();
FILE *fp = fopen(path, "r");
if (fp != NULL) {
splash_window.content.type = STATIC;
......@@ -50,6 +43,12 @@ void splash(char *path) {
gen_err_opening(&splash_window.content);
}
splash_window.window = initscr();
cbreak();
halfdelay(1);
noecho();
curs_set(0);
splash_window.cols = COLS;
splash_window.rows = LINES;
splash_window.scroll = 0;
......@@ -66,9 +65,11 @@ void splash(char *path) {
wrefresh(splash_window.window);
int ch = getch();
while (ch == ERR) {
// 410: idk why, but it has to do with SIGWINCH
while (ch == ERR || ch == 410) {
if (splash_window.content.type == STATIC) {
anim_tick(&splash_window);
wrefresh(splash_window.window);
}
ch = getch();
}
......
......@@ -18,8 +18,6 @@
#ifndef _TELNET_SPLASH_SITE_H
#define _TELNET_SPLASH_SITE_H
#include <ncurses.h>
void splash(char *path);
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment