try to not stomp all over ncurses' WINCH handler (Jesse Luehrs <doy@tozt.net>)

git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@604 db0b04b0-f4d1-0310-9a6d-de3e77497b0e
This commit is contained in:
Pasi Kallinen 2011-10-03 15:42:30 +00:00
parent 6942ccae67
commit b2ffeb7c3e
2 changed files with 6 additions and 2 deletions

View File

@ -100,6 +100,7 @@ extern int yyparse ();
char * __progname;
int g_idle_alarm_enabled = 0;
void (*g_chain_winch)(int);
#ifndef USE_SQLITE3
int f_num = 0;
@ -2535,8 +2536,6 @@ main (int argc, char** argv)
signal (SIGQUIT, catch_sighup);
signal (SIGTERM, catch_sighup);
signal(SIGWINCH, sigwinch_func);
(void) tcgetattr (0, &tt);
if (-1 == ioctl (0, TIOCGWINSZ, (char *) &win) || win.ws_row < 4 ||
win.ws_col < 4) /* Rudimentary validity check */
@ -2650,6 +2649,9 @@ main (int argc, char** argv)
}
initcurses ();
g_chain_winch = signal(SIGWINCH, sigwinch_func);
term_resize_check();
idle_alarm_set_enabled(1);

View File

@ -18,6 +18,7 @@
extern FILE* yyin;
extern int yyparse ();
extern void (*g_chain_winch)(int);
/* Data structures */
struct dg_config **myconfig = NULL;
@ -74,6 +75,7 @@ sigwinch_func(int sig)
{
signal(SIGWINCH, sigwinch_func);
curses_resize = 1;
g_chain_winch(sig);
}
void