Move SIGWINCH handling to ui/core.c, ignore signal whilst resizing

This commit is contained in:
James Booth
2015-02-04 23:35:28 +00:00
parent d64c4a69d7
commit 30180ac8bb
5 changed files with 18 additions and 9 deletions

View File

@@ -79,6 +79,8 @@ static char *win_title;
static int inp_size;
static gboolean perform_resize = FALSE;
#ifdef HAVE_LIBXSS
static Display *display;
#endif
@@ -120,6 +122,12 @@ ui_init(void)
win_update_virtual(window);
}
void
ui_sigwinch_handler(int sig)
{
perform_resize = TRUE;
}
void
ui_update(void)
{
@@ -137,6 +145,13 @@ ui_update(void)
status_bar_update_virtual();
inp_put_back();
doupdate();
if (perform_resize) {
signal(SIGWINCH, SIG_IGN);
ui_resize();
perform_resize = FALSE;
signal(SIGWINCH, ui_sigwinch_handler);
}
}
void