From 30180ac8bb125e4cae03c415201f796863d4c80b Mon Sep 17 00:00:00 2001 From: James Booth Date: Wed, 4 Feb 2015 23:35:28 +0000 Subject: Move SIGWINCH handling to ui/core.c, ignore signal whilst resizing --- src/ui/core.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/ui/core.c') diff --git a/src/ui/core.c b/src/ui/core.c index de3bafd2..add80dff 100644 --- a/src/ui/core.c +++ b/src/ui/core.c @@ -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 -- cgit 1.4.1-2-gfad0